Skip to content
Snippets Groups Projects
Commit a8b9ee6f authored by Ian Lance Taylor's avatar Ian Lance Taylor
Browse files

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
parent bee60edc
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment