diff mbox

libgo patch committed: Fix reflect.Call

Message ID mcrpq3vmw7f.fsf@google.com
State New
Headers show

Commit Message

Ian Lance Taylor Nov. 2, 2012, 11:17 p.m. UTC
Part of my initial 64-bit support patch was bogus: I shadowed a variable
in a couple of functions used for reflect.Call.  This patch fixes it.
Bootstrapped and ran Go testsuite on x86_64-unknown-linux-gnu.
Committed to mainline.

Ian
diff mbox

Patch

diff -r cecca11207b7 libgo/runtime/go-reflect-call.c
--- a/libgo/runtime/go-reflect-call.c	Thu Nov 01 14:42:39 2012 -0700
+++ b/libgo/runtime/go-reflect-call.c	Fri Nov 02 16:15:20 2012 -0700
@@ -75,15 +75,15 @@ 
     const struct __go_slice_type *descriptor __attribute__ ((unused)))
 {
   ffi_type *ret;
-  ffi_type *intgo;
+  ffi_type *ffi_intgo;
 
   ret = (ffi_type *) __go_alloc (sizeof (ffi_type));
   ret->type = FFI_TYPE_STRUCT;
   ret->elements = (ffi_type **) __go_alloc (4 * sizeof (ffi_type *));
   ret->elements[0] = &ffi_type_pointer;
-  intgo = sizeof (intgo) == 4 ? &ffi_type_sint32 : &ffi_type_sint64;
-  ret->elements[1] = intgo;
-  ret->elements[2] = intgo;
+  ffi_intgo = sizeof (intgo) == 4 ? &ffi_type_sint32 : &ffi_type_sint64;
+  ret->elements[1] = ffi_intgo;
+  ret->elements[2] = ffi_intgo;
   ret->elements[3] = NULL;
   return ret;
 }
@@ -117,14 +117,14 @@ 
 go_string_to_ffi (void)
 {
   ffi_type *ret;
-  ffi_type *intgo;
+  ffi_type *ffi_intgo;
 
   ret = (ffi_type *) __go_alloc (sizeof (ffi_type));
   ret->type = FFI_TYPE_STRUCT;
   ret->elements = (ffi_type **) __go_alloc (3 * sizeof (ffi_type *));
   ret->elements[0] = &ffi_type_pointer;
-  intgo = sizeof (intgo) == 4 ? &ffi_type_sint32 : &ffi_type_sint64;
-  ret->elements[1] = intgo;
+  ffi_intgo = sizeof (intgo) == 4 ? &ffi_type_sint32 : &ffi_type_sint64;
+  ret->elements[1] = ffi_intgo;
   ret->elements[2] = NULL;
   return ret;
 }