diff options
author | Björn Gustavsson <[email protected]> | 2018-06-14 11:27:19 +0200 |
---|---|---|
committer | GitHub <[email protected]> | 2018-06-14 11:27:19 +0200 |
commit | 766b968d89e3cf0b2715ba4784887b1ae8c4181d (patch) | |
tree | adc364f4fc47c7f9d123c5a09b17810c00688222 /lib/hipe/rtl | |
parent | 6c10df2098cd626a2a2377523bbb04687f9dd7a2 (diff) | |
parent | 1d48b1114d195228c750fd0fcd98cb223c714479 (diff) | |
download | otp-766b968d89e3cf0b2715ba4784887b1ae8c4181d.tar.gz otp-766b968d89e3cf0b2715ba4784887b1ae8c4181d.tar.bz2 otp-766b968d89e3cf0b2715ba4784887b1ae8c4181d.zip |
Merge pull request #1837 from kostis/hipe-lcm-21-fix
Fix a crash in HiPE's lazy code motion pass
Diffstat (limited to 'lib/hipe/rtl')
-rw-r--r-- | lib/hipe/rtl/hipe_rtl_lcm.erl | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/lib/hipe/rtl/hipe_rtl_lcm.erl b/lib/hipe/rtl/hipe_rtl_lcm.erl index af39c9a0a4..2c8cc80e56 100644 --- a/lib/hipe/rtl/hipe_rtl_lcm.erl +++ b/lib/hipe/rtl/hipe_rtl_lcm.erl @@ -267,14 +267,17 @@ try_insert_expr_last(CFG0, Label, Instr) -> %% with the new code inserted second to last (assuming the last expression %% is a branch operation). insert_expr_last_work(_Instr, [#call{}]) -> - %% Call instructions clobber all expressions; we musn't insert the expression - %% before it + %% Call instructions clobber all expressions; we must not insert the + %% expression before it not_safe; insert_expr_last_work(Instr, [Code1]) -> %% We insert the code next to last. [Instr, Code1]; insert_expr_last_work(Instr, [Code|Codes]) -> - [Code|insert_expr_last_work(Instr, Codes)]. + case insert_expr_last_work(Instr, Codes) of + not_safe -> not_safe; + NewCodes -> [Code|NewCodes] + end. %%============================================================================= %% Inserts expression first in the block for the given label. |