Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
home:Ledest:erlang:24
erlang
0590-Eliminate-crash-in-dialyzer_dep.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File 0590-Eliminate-crash-in-dialyzer_dep.patch of Package erlang
From 937808d6dd2d0bd011173bc57479d9fdd750df82 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Gustavsson?= <bjorn@erlang.org> Date: Thu, 1 Dec 2022 04:58:23 +0100 Subject: [PATCH] Eliminate crash in dialyzer_dep Closes #6518 --- lib/dialyzer/src/dialyzer_dep.erl | 26 +++++++++++-------- .../test/small_SUITE_data/src/gh_6518.erl | 12 +++++++++ 2 files changed, 27 insertions(+), 11 deletions(-) create mode 100644 lib/dialyzer/test/small_SUITE_data/src/gh_6518.erl diff --git a/lib/dialyzer/src/dialyzer_dep.erl b/lib/dialyzer/src/dialyzer_dep.erl index c565a0a612..c869be76a3 100644 --- a/lib/dialyzer/src/dialyzer_dep.erl +++ b/lib/dialyzer/src/dialyzer_dep.erl @@ -124,22 +124,26 @@ traverse(Tree, Out, State, CurrentFun) -> {merge_outs([HdFuns, TlFuns]), State2}; 'fun' -> %% io:format("Entering fun: ~w\n", [cerl_trees:get_label(Tree)]), + OldNumRvals = state__num_rvals(State), + State1 = state__store_num_rvals(1, State), Body = cerl:fun_body(Tree), Label = cerl_trees:get_label(Tree), - State1 = - if CurrentFun =:= top -> - state__add_deps(top, output(set__singleton(Label)), State); - true -> - O1 = output(set__singleton(CurrentFun)), - O2 = output(set__singleton(Label)), - TmpState = state__add_deps(Label, O1, State), - state__add_deps(CurrentFun, O2,TmpState) + State2 = + if + CurrentFun =:= top -> + state__add_deps(top, output(set__singleton(Label)), State1); + true -> + O1 = output(set__singleton(CurrentFun)), + O2 = output(set__singleton(Label)), + TmpState = state__add_deps(Label, O1, State1), + state__add_deps(CurrentFun, O2, TmpState) end, Vars = cerl:fun_vars(Tree), Out1 = bind_single(Vars, output(set__singleton(external)), Out), - {BodyFuns, State2} = - traverse(Body, Out1, State1, cerl_trees:get_label(Tree)), - {output(set__singleton(Label)), state__add_esc(BodyFuns, State2)}; + {BodyFuns, State3} = + traverse(Body, Out1, State2, cerl_trees:get_label(Tree)), + State4 = state__store_num_rvals(OldNumRvals, State3), + {output(set__singleton(Label)), state__add_esc(BodyFuns, State4)}; 'let' -> Vars = cerl:let_vars(Tree), Arg = cerl:let_arg(Tree), diff --git a/lib/dialyzer/test/small_SUITE_data/src/gh_6518.erl b/lib/dialyzer/test/small_SUITE_data/src/gh_6518.erl new file mode 100644 index 0000000000..794548b37a --- /dev/null +++ b/lib/dialyzer/test/small_SUITE_data/src/gh_6518.erl @@ -0,0 +1,12 @@ +-module(gh_6518). +-export([f/1]). + +f(X) -> + case + fun() -> + [ok || _ <- []] + end + of + _ -> + (Y = X) + end andalso Y. -- 2.35.3
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