compile: add type conversion in Type::gc_symbol_pointer
authorIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Dec 2016 18:03:39 +0000 (18:03 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Fri, 30 Dec 2016 18:03:39 +0000 (18:03 +0000)
    Wrap the return from Type::gc_symbol_pointer with a type conversion to
    uintptr, since the values returned are stored into structure fields
    with that type.

    Reviewed-on: https://go-review.googlesource.com/34625

From-SVN: r243978

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/types.cc

index 9392c940d99919f1b3d271187b2317bcdbddb494..b03fb620a9788c0a68826f22a925e7dd88d9d329 100644 (file)
@@ -1,4 +1,4 @@
-d9be5f5d7907cbc169424fe2b8532cc3919cad5b
+ebe9d824adca053066837b8b19461048ced34aff
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 93d7d807aa8e75e1c26a3329da6931f5e874d515..e7fe326357d659a59d5d6e86cbb7c4c86f5f2a5a 100644 (file)
@@ -2138,7 +2138,10 @@ Type::gc_symbol_pointer(Gogo* gogo)
   Location bloc = Linemap::predeclared_location();
   Bexpression* var_expr =
       gogo->backend()->var_expression(t->gc_symbol_var_, VE_rvalue, bloc);
-  return gogo->backend()->address_expression(var_expr, bloc);
+  Bexpression* addr_expr =
+      gogo->backend()->address_expression(var_expr, bloc);
+  Btype* ubtype = Type::lookup_integer_type("uintptr")->get_backend(gogo);
+  return gogo->backend()->convert_expression(ubtype, addr_expr, bloc);
 }
 
 // A mapping from unnamed types to GC symbol variables.