aboutsummaryrefslogtreecommitdiffstats
path: root/lib/compiler/src/beam_type.erl
diff options
context:
space:
mode:
authorBjörn Gustavsson <[email protected]>2012-08-15 11:05:30 +0200
committerBjörn Gustavsson <[email protected]>2012-08-15 11:05:30 +0200
commitc5e5cf792d87e0d23f80ff572f499f0e3e044933 (patch)
tree585bc144e76486ed0959e4675015fbb760c6c33c /lib/compiler/src/beam_type.erl
parent9492bf7abbf5e43a9bdada5b0ace0432ce1f4223 (diff)
parent6cdc6b667a8db2b63a4613c63dc4f75a34a5ea7f (diff)
downloadotp-c5e5cf792d87e0d23f80ff572f499f0e3e044933.tar.gz
otp-c5e5cf792d87e0d23f80ff572f499f0e3e044933.tar.bz2
otp-c5e5cf792d87e0d23f80ff572f499f0e3e044933.zip
Merge branch 'bjorn/compiler/minor-fixes/OTP-10185' into maint
* bjorn/compiler/minor-fixes/OTP-10185: erl_lint: Add a deprecated warning for literal tuple funs beam_utils:live_opt/1: Correct handling of try_case_end/1 Correct guard_SUITE_tuple_size.S beam_type: Print the offending function if this pass crashes beam_validator: Validate the size operand in bs_init_bits and bs_init2
Diffstat (limited to 'lib/compiler/src/beam_type.erl')
-rw-r--r--lib/compiler/src/beam_type.erl15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/compiler/src/beam_type.erl b/lib/compiler/src/beam_type.erl
index 6f0ffb5b25..d307d192b2 100644
--- a/lib/compiler/src/beam_type.erl
+++ b/lib/compiler/src/beam_type.erl
@@ -29,10 +29,17 @@ module({Mod,Exp,Attr,Fs0,Lc}, _Opts) ->
{ok,{Mod,Exp,Attr,Fs,Lc}}.
function({function,Name,Arity,CLabel,Asm0}) ->
- Asm1 = beam_utils:live_opt(Asm0),
- Asm2 = opt(Asm1, [], tdb_new()),
- Asm = beam_utils:delete_live_annos(Asm2),
- {function,Name,Arity,CLabel,Asm}.
+ try
+ Asm1 = beam_utils:live_opt(Asm0),
+ Asm2 = opt(Asm1, [], tdb_new()),
+ Asm = beam_utils:delete_live_annos(Asm2),
+ {function,Name,Arity,CLabel,Asm}
+ catch
+ Class:Error ->
+ Stack = erlang:get_stacktrace(),
+ io:fwrite("Function: ~w/~w\n", [Name,Arity]),
+ erlang:raise(Class, Error, Stack)
+ end.
%% opt([Instruction], Accumulator, TypeDb) -> {[Instruction'],TypeDb'}
%% Keep track of type information; try to simplify.