diff options
author | Björn Gustavsson <[email protected]> | 2012-01-25 14:59:18 +0100 |
---|---|---|
committer | Björn Gustavsson <[email protected]> | 2012-01-25 14:59:18 +0100 |
commit | 328213de5cc0c93bf91559be938aff8fb4174b98 (patch) | |
tree | 973b44121f42d039e25b903aab1fdbdd85feb54d /lib/compiler/src/beam_utils.erl | |
parent | 8b129dda86fe28b943180153561423bbb7957582 (diff) | |
parent | 4c6e2c2d775bc785db7de174e12227e87d2bc542 (diff) | |
download | otp-328213de5cc0c93bf91559be938aff8fb4174b98.tar.gz otp-328213de5cc0c93bf91559be938aff8fb4174b98.tar.bz2 otp-328213de5cc0c93bf91559be938aff8fb4174b98.zip |
Merge branch 'bjorn/compiler/get-in-try/OTP-9867' into maint
* bjorn/compiler/get-in-try/OTP-9867:
compiler: Correct live calculation when get/1 is used in try...catch
Diffstat (limited to 'lib/compiler/src/beam_utils.erl')
-rw-r--r-- | lib/compiler/src/beam_utils.erl | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/lib/compiler/src/beam_utils.erl b/lib/compiler/src/beam_utils.erl index a631b8cd69..116ede0bc9 100644 --- a/lib/compiler/src/beam_utils.erl +++ b/lib/compiler/src/beam_utils.erl @@ -474,8 +474,15 @@ check_liveness(R, [{make_fun2,_,_,_,NumFree}|Is], St) -> end; check_liveness(R, [{try_end,Y}|Is], St) -> case R of - Y -> {killed,St}; - _ -> check_liveness(R, Is, St) + Y -> + {killed,St}; + {y,_} -> + %% y registers will be used if an exception occurs and + %% control transfers to the label given in the previous + %% try/2 instruction. + {used,St}; + _ -> + check_liveness(R, Is, St) end; check_liveness(R, [{catch_end,Y}|Is], St) -> case R of |