This is the mail archive of the gcc-patches@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Go patch committed: Fix double evaluation when using interface field expression


This patch to the Go frontend by Cherry Zhang fixes the compiler to
avoid a double evaluation of an interface field expression.  In
Interface_field_reference_expression, the interface expression is used
in two places, so a temporary variable is used.  Previously, we used a
Set_and_use_temporary_expression, which, when evaluated twice, causes
double evaluation of the underlying expression.  Fix by setting the
temporary once and use Temporary_reference_expression instead.

This fixes https://golang.org/issue/26248.  The test case for this is
in https://golang.org/cl/122757.

Bootstrapped and ran Go testsuite on x86_64-pc-linux-gnu.  Committed
to mainline.

Ian

Attachment: patch.txt
Description: Text document


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]