Commit 7d5c5052 by Ian Lance Taylor

compile: add type conversion in Type::gc_symbol_pointer

    
    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
parent 9085a4c1
d9be5f5d7907cbc169424fe2b8532cc3919cad5b ebe9d824adca053066837b8b19461048ced34aff
The first line of this file holds the git revision number of the last The first line of this file holds the git revision number of the last
merge done from the gofrontend repository. merge done from the gofrontend repository.
...@@ -2138,7 +2138,10 @@ Type::gc_symbol_pointer(Gogo* gogo) ...@@ -2138,7 +2138,10 @@ Type::gc_symbol_pointer(Gogo* gogo)
Location bloc = Linemap::predeclared_location(); Location bloc = Linemap::predeclared_location();
Bexpression* var_expr = Bexpression* var_expr =
gogo->backend()->var_expression(t->gc_symbol_var_, VE_rvalue, bloc); 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. // A mapping from unnamed types to GC symbol variables.
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment