Commit d3026797 authored by David Bühler's avatar David Bühler
Browse files

[From] Fixes a crash when the main function has no body.

parent ff2a2b64
...@@ -68,14 +68,13 @@ let call_for_individual_froms (call_type, value_initial_state, call_stack) = ...@@ -68,14 +68,13 @@ let call_for_individual_froms (call_type, value_initial_state, call_stack) =
if From_parameters.ForceCallDeps.get () then begin if From_parameters.ForceCallDeps.get () then begin
let current_function, call_site = List.hd call_stack in let current_function, call_site = List.hd call_stack in
let register_from froms = let register_from froms =
try record_callwise_dependencies_in_db call_site froms;
let { table_for_calls = table } = List.hd !call_froms_stack in match !call_froms_stack with
merge_call_froms table call_site froms; | { table_for_calls } :: _ ->
record_callwise_dependencies_in_db call_site froms; merge_call_froms table_for_calls call_site froms;
with Failure _ -> | [] ->
From_parameters.fatal (* Empty call stack: this is the main entry point with no call site. *)
"calldeps internal error 23 empty callfromsstack %a" assert (call_site = Cil_types.Kglobal);
Kernel_function.pretty current_function
in in
let compute_from_behaviors bhv = let compute_from_behaviors bhv =
let assigns = Ast_info.merge_assigns bhv in let assigns = Ast_info.merge_assigns bhv in
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment