-
- Downloads
compiler: ensure evaluation order in type hash/eq functions
The type hash and equality functions are generated after the order_evaluations pass. They may contain shortcut operators and Set_and_use_temporary_expressions (e.g. from lowering a Binary_exprssion) that need to be ordered. Run order_evaluations and remove_shortcuts on these functions. (The hash functions may be fine, but to be on the safe side we run on them anyway. We do need to run on the equality functions.) A Set_and_use_temporary_expression is effectively an assignment, so it needs to be ordered. Otherwise if we insert a temporary statement before it, we may get wrong evaluation order. A test case is CL 185818. Fixes golang/go#33062. Reviewed-on: https://go-review.googlesource.com/c/gofrontend/+/185817 From-SVN: r273425
Showing
- gcc/go/gofrontend/MERGE 1 addition, 1 deletiongcc/go/gofrontend/MERGE
- gcc/go/gofrontend/expressions.h 4 additions, 0 deletionsgcc/go/gofrontend/expressions.h
- gcc/go/gofrontend/gogo.cc 18 additions, 0 deletionsgcc/go/gofrontend/gogo.cc
- gcc/go/gofrontend/gogo.h 8 additions, 0 deletionsgcc/go/gofrontend/gogo.h
- gcc/go/gofrontend/types.cc 4 additions, 0 deletionsgcc/go/gofrontend/types.cc
Loading
Please register or sign in to comment