summaryrefslogtreecommitdiff
path: root/lib/compiler/src/sys_core_fold.erl
diff options
context:
space:
mode:
Diffstat (limited to 'lib/compiler/src/sys_core_fold.erl')
-rw-r--r--lib/compiler/src/sys_core_fold.erl12
1 files changed, 5 insertions, 7 deletions
diff --git a/lib/compiler/src/sys_core_fold.erl b/lib/compiler/src/sys_core_fold.erl
index 01e9987196..5cc7529469 100644
--- a/lib/compiler/src/sys_core_fold.erl
+++ b/lib/compiler/src/sys_core_fold.erl
@@ -897,8 +897,9 @@ fold_lit_args(Call, Module, Name, Args0) ->
end
catch
error:Reason ->
- %% Evaluation of the function failed. Warn and replace
- %% the call with a call to erlang:error/1.
+ %% Evaluation of the function failed. Warn but keep
+ %% the call to ensure that extended error information
+ %% will be available at runtime.
eval_failure(Call, Reason)
end.
@@ -959,15 +960,12 @@ eval_append(Call, X, Y) ->
Call#c_call{args=[X,Y]}. %Rebuild call arguments.
%% eval_failure(Call, Reason) -> Core.
-%% Warn for a call that will fail and replace the call with
-%% a call to erlang:error(Reason).
+%% Warn for a call that will fail but keep the call.
%%
eval_failure(Call, Reason) ->
Classified = classify_call(Call),
add_warning(Call, {failed,{eval_failure,Classified,Reason}}),
- Call#c_call{module=#c_literal{val=erlang},
- name=#c_literal{val=error},
- args=[#c_literal{val=Reason}]}.
+ Call.
%% simplify_apply(Call0, Mod, Func, Args) -> Call
%% Simplify an apply/3 to a call if the number of arguments