aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2010-09-01 16:41:47 +0200
committerBjörn Gustavsson <[email protected]>2010-09-01 16:41:52 +0200
commit7f3922afdc69ba7cc8678c521b0be37c46112c67 (patch)
treea93a030105bf5858ec254266eb632db52e4b8eb4 /lib
parente54ddf7c0d3681364b9f335fffd5f95e8d689d9b (diff)
parent499295576712b14314ebc8f9753af7f0e1198080 (diff)
downloadotp-7f3922afdc69ba7cc8678c521b0be37c46112c67.tar.gz
otp-7f3922afdc69ba7cc8678c521b0be37c46112c67.tar.bz2
otp-7f3922afdc69ba7cc8678c521b0be37c46112c67.zip
Merge branch 'mp/fix-hipe-icode-exceptions' into dev
* mp/fix-hipe-icode-exceptions: fix crash in hipe_icode_exceptions OTP-8800
Diffstat (limited to 'lib')
-rw-r--r--lib/hipe/icode/hipe_icode_exceptions.erl10
1 files changed, 10 insertions, 0 deletions
diff --git a/lib/hipe/icode/hipe_icode_exceptions.erl b/lib/hipe/icode/hipe_icode_exceptions.erl
index 787fb05415..3c8f7b5712 100644
--- a/lib/hipe/icode/hipe_icode_exceptions.erl
+++ b/lib/hipe/icode/hipe_icode_exceptions.erl
@@ -344,6 +344,16 @@ pop_catch(Cs) ->
pop_catch_1([[_|C] | Cs]) ->
[C | pop_catch_1(Cs)];
+pop_catch_1([[] | Cs]) ->
+ %% The elements in the list represent different possible incoming
+ %% stacks of catch handlers to this BB. Before the fixpoint has
+ %% been found these elements are underapproximations of the true
+ %% stacks, therefore it's possible for these elements to be too
+ %% short for the number of pops implied by the code in the BB.
+ %% We must not fail in that case, so we set pop([]) = [].
+ %% This fixes find_catches_crash.erl and compiler_tests in the
+ %% HiPE test suite.
+ [[] | pop_catch_1(Cs)];
pop_catch_1([]) ->
[].