Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:23
erlang
2923-beam_ssa_type-Print-out-name-of-offending-...
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 2923-beam_ssa_type-Print-out-name-of-offending-function-o.patch of Package erlang
From d4836978ec4bdc639c2b47410f810ce9d1ffd0e3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Fri, 5 Feb 2021 06:57:48 +0100 Subject: [PATCH 13/18] beam_ssa_type: Print out name of offending function on crash --- lib/compiler/src/beam_ssa_type.erl | 24 ++++++++++++++++++++++-- 1 file changed, 22 insertions(+), 2 deletions(-) diff --git a/lib/compiler/src/beam_ssa_type.erl b/lib/compiler/src/beam_ssa_type.erl index a640f3fff1..5801bbbc08 100644 --- a/lib/compiler/src/beam_ssa_type.erl +++ b/lib/compiler/src/beam_ssa_type.erl @@ -144,7 +144,17 @@ signatures_1(StMap, FuncDb0, State0) -> {State0, FuncDb0} end. -sig_function(Id, StMap, State0, FuncDb0) -> +sig_function(Id, StMap, State, FuncDb) -> + try + do_sig_function(Id, StMap, State, FuncDb) + catch + Class:Error:Stack -> + #b_local{name=#b_literal{val=Name},arity=Arity} = Id, + io:fwrite("Function: ~w/~w\n", [Name,Arity]), + erlang:raise(Class, Error, Stack) + end. + +do_sig_function(Id, StMap, State0, FuncDb0) -> case sig_function_1(Id, StMap, State0, FuncDb0) of {false, false, State, FuncDb} -> %% No added work and the types are identical. Pop ourselves from @@ -416,7 +426,17 @@ join_arg_types([], [], Ts) -> Ts :: type_db(), FuncDb :: func_info_db(), Result :: {Linear, FuncDb}. -opt_function(Linear0, Args, Id, Ts, FuncDb0) -> +opt_function(Linear, Args, Id, Ts, FuncDb) -> + try + do_opt_function(Linear, Args, Id, Ts, FuncDb) + catch + Class:Error:Stack -> + #b_local{name=#b_literal{val=Name},arity=Arity} = Id, + io:fwrite("Function: ~w/~w\n", [Name,Arity]), + erlang:raise(Class, Error, Stack) + end. + +do_opt_function(Linear0, Args, Id, Ts, FuncDb0) -> FakeCall = #b_set{op=call,args=[#b_remote{mod=#b_literal{val=unknown}, name=#b_literal{val=unknown}, arity=0}]}, -- 2.26.2
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor