aboutsummaryrefslogtreecommitdiffstats
path: root/lib/dialyzer
diff options
context:
space:
mode:
Diffstat (limited to 'lib/dialyzer')
-rw-r--r--lib/dialyzer/src/dialyzer_callgraph.erl9
-rw-r--r--lib/dialyzer/src/dialyzer_dataflow.erl21
2 files changed, 15 insertions, 15 deletions
diff --git a/lib/dialyzer/src/dialyzer_callgraph.erl b/lib/dialyzer/src/dialyzer_callgraph.erl
index 1cbb83a44a..ddda27adb4 100644
--- a/lib/dialyzer/src/dialyzer_callgraph.erl
+++ b/lib/dialyzer/src/dialyzer_callgraph.erl
@@ -48,6 +48,7 @@
get_required_by/2,
in_neighbours/2,
renew_race_info/4,
+ renew_race_code/2,
reset_from_funs/2,
scan_core_tree/2,
strip_module_deps/2,
@@ -239,6 +240,14 @@ renew_race_info(CG, RaceCode, PublicTables, NamedTables) ->
public_tables = PublicTables,
named_tables = NamedTables}.
+-spec renew_race_code(dialyzer_races:races(), callgraph()) -> callgraph().
+
+renew_race_code(Races, #callgraph{race_code = RaceCode} = Callgraph) ->
+ Fun = dialyzer_races:get_curr_fun(Races),
+ FunArgs = dialyzer_races:get_curr_fun_args(Races),
+ Code = lists:reverse(dialyzer_races:get_race_list(Races)),
+ Callgraph#callgraph{race_code = dict:store(Fun, [FunArgs, Code], RaceCode)}.
+
-spec get_depends_on(scc(), callgraph()) -> [scc()].
get_depends_on(SCC, #callgraph{active_digraph = DG}) ->
diff --git a/lib/dialyzer/src/dialyzer_dataflow.erl b/lib/dialyzer/src/dialyzer_dataflow.erl
index bd375b04fa..ad07524fa6 100644
--- a/lib/dialyzer/src/dialyzer_dataflow.erl
+++ b/lib/dialyzer/src/dialyzer_dataflow.erl
@@ -358,16 +358,7 @@ analyze_loop(#state{callgraph = Callgraph, races = Races} = State) ->
t_to_string(t_fun(ArgTypes, BodyType))]),
NewState5 =
case RaceDetection andalso RaceAnalysis of
- true ->
- Races1 = NewState4#state.races,
- Code = lists:reverse(dialyzer_races:get_race_list(Races1)),
- Callgraph1 =
- renew_code(dialyzer_races:get_curr_fun(Races1),
- dialyzer_races:get_curr_fun_args(Races1),
- Code,
- state__warning_mode(NewState4),
- NewState4#state.callgraph),
- NewState4#state{callgraph = Callgraph1};
+ true -> renew_race_code(NewState4);
false -> NewState4
end,
NewState6 =
@@ -3342,13 +3333,13 @@ state__records_only(#state{records = Records}) ->
%%%
%%% ===========================================================================
-renew_code(Fun, FunArgs, Code, WarningMode, Callgraph) ->
+renew_race_code(#state{races = Races, callgraph = Callgraph,
+ warning_mode = WarningMode} = State) ->
case WarningMode of
- true -> Callgraph;
+ true -> State;
false ->
- RaceCode = dialyzer_callgraph:get_race_code(Callgraph),
- dialyzer_callgraph:put_race_code(
- dict:store(Fun, [FunArgs, Code], RaceCode), Callgraph)
+ NewCallgraph = dialyzer_callgraph:renew_race_code(Races, Callgraph),
+ State#state{callgraph = NewCallgraph}
end.
renew_public_tables([Var], Table, WarningMode, Callgraph) ->