linker: Require an exact matching signature when looking for prototypes.
authorKenneth Graunke <kenneth@whitecape.org>
Tue, 31 Aug 2010 03:42:19 +0000 (20:42 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 31 Aug 2010 04:04:13 +0000 (21:04 -0700)
Fixes piglit test glsl-override-builtin.  The linker incorrectly found
the prototype for the float signature, rather than adding a new
prototype with the int return type.  This caused ir_calls with type int
to have their callees set to the float signature, triggering an assert.

src/glsl/link_functions.cpp

index 6374573e6142558523eaa09d43b0e613511de580..78c8b48cf179c4060caa13c2a3cc91644eeaccb5 100644 (file)
@@ -111,7 +111,7 @@ public:
         f = new(linked) ir_function(name);
 
       ir_function_signature *linked_sig =
-        f->matching_signature(&callee->parameters);
+        f->exact_matching_signature(&callee->parameters);
       if (linked_sig == NULL) {
         linked_sig = new(linked) ir_function_signature(callee->return_type);
         f->add_signature(linked_sig);