Commit 02c7e7eb by Ian Lance Taylor

compiler: add backend type conversion

    
    Tweak Interface_field_reference_expression::do_get_backend to apply an
    additional backend type conversion to the returned result.  This is
    needed due to the fact that the top level type of the expression is a
    function descriptor, however the value being manufactured is a pointer
    to <thunk-descriptor, value> struct.
    
    Reviewed-on: https://go-review.googlesource.com/51712

From-SVN: r250686
parent 5a427c63
2118958321532352c91fd9406f571f8729a791cd f7c36b27a49131f60eedde260896d310d735d408
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.
...@@ -12057,12 +12057,15 @@ Interface_field_reference_expression::do_get_backend(Translate_context* context) ...@@ -12057,12 +12057,15 @@ Interface_field_reference_expression::do_get_backend(Translate_context* context)
Bexpression* bclosure = Bexpression* bclosure =
Expression::make_heap_expression(expr, loc)->get_backend(context); Expression::make_heap_expression(expr, loc)->get_backend(context);
Gogo* gogo = context->gogo();
Btype* btype = this->type()->get_backend(gogo);
bclosure = gogo->backend()->convert_expression(btype, bclosure, loc);
Expression* nil_check = Expression* nil_check =
Expression::make_binary(OPERATOR_EQEQ, this->expr_, Expression::make_binary(OPERATOR_EQEQ, this->expr_,
Expression::make_nil(loc), loc); Expression::make_nil(loc), loc);
Bexpression* bnil_check = nil_check->get_backend(context); Bexpression* bnil_check = nil_check->get_backend(context);
Gogo* gogo = context->gogo();
Bexpression* bcrash = gogo->runtime_error(RUNTIME_ERROR_NIL_DEREFERENCE, Bexpression* bcrash = gogo->runtime_error(RUNTIME_ERROR_NIL_DEREFERENCE,
loc)->get_backend(context); loc)->get_backend(context);
......
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