compiler: containing small bfunction mixup in Gogo::write_globals
authorIan Lance Taylor <ian@gcc.gnu.org>
Tue, 13 Jun 2017 14:26:07 +0000 (14:26 +0000)
committerIan Lance Taylor <ian@gcc.gnu.org>
Tue, 13 Jun 2017 14:26:07 +0000 (14:26 +0000)
    Fix buglet in Gogo::write_globals-- in a couple of places the
    wrong Bfunction was being used for the containing (not target)
    function when creating calls for init functions.

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

From-SVN: r249159

gcc/go/gofrontend/MERGE
gcc/go/gofrontend/gogo.cc

index 78bd0574fb6e052a62d9e97f193ee56ef8d9eb09..2d9adafbdd5882d3a5f9ca6f7db3c45853407a1b 100644 (file)
@@ -1,4 +1,4 @@
-c4ecdd3edb9febe72b5527481ae3d7310105ca67
+be5fa26b2b1b5d0755bc1c7ce25f3aa26bea9d9c
 
 The first line of this file holds the git revision number of the last
 merge done from the gofrontend repository.
index 9071bc8f62df1bbfbdc510b87cefb3f25b558195..a9d72ff4aa06675ed7f43ffac703f37e2efe8342 100644 (file)
@@ -1504,10 +1504,10 @@ Gogo::write_globals()
       Bfunction* initfn = func->get_or_make_decl(this, *p);
       Bexpression* func_code =
           this->backend()->function_code_expression(initfn, func_loc);
-      Bexpression* call = this->backend()->call_expression(initfn, func_code,
+      Bexpression* call = this->backend()->call_expression(init_bfn, func_code,
                                                            empty_args,
                                                           NULL, func_loc);
-      Bstatement* ist = this->backend()->expression_statement(initfn, call);
+      Bstatement* ist = this->backend()->expression_statement(init_bfn, call);
       init_stmts.push_back(ist);
     }