aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/v3_codegen.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2015-04-24 10:03:42 +0200
committerBjörn Gustavsson <[email protected]>2015-04-29 12:24:43 +0200
commit2838a341f074dbc4597d90af86e2dda6647dd083 (patch)
tree4a3e12313f4fb6e6f5e409db31b13d23b401120b /lib/compiler/src/v3_codegen.erl
parent41c1f4c3eab54d776e2287cab09cc4ab0f7ee25e (diff)
downloadotp-2838a341f074dbc4597d90af86e2dda6647dd083.tar.gz
otp-2838a341f074dbc4597d90af86e2dda6647dd083.tar.bz2
otp-2838a341f074dbc4597d90af86e2dda6647dd083.zip
v3_core, v3_codegen: Eliminate old-style catches
Diffstat (limited to 'lib/compiler/src/v3_codegen.erl')
-rw-r--r--lib/compiler/src/v3_codegen.erl8
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/compiler/src/v3_codegen.erl b/lib/compiler/src/v3_codegen.erl
index 15a54a5886..aa2ebc0f85 100644
--- a/lib/compiler/src/v3_codegen.erl
+++ b/lib/compiler/src/v3_codegen.erl
@@ -2140,9 +2140,11 @@ put_stack(Val, [free|Stk]) -> [{Val}|Stk];
put_stack(Val, [NotFree|Stk]) -> [NotFree|put_stack(Val, Stk)].
put_stack_carefully(Val, Stk0) ->
- case catch put_stack_carefully1(Val, Stk0) of
- error -> error;
- Stk1 when is_list(Stk1) -> Stk1
+ try
+ put_stack_carefully1(Val, Stk0)
+ catch
+ throw:error ->
+ error
end.
put_stack_carefully1(_, []) -> throw(error);