Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed stack overflow issue in disambiguation tool #986

Merged
merged 2 commits into from
May 5, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 2 additions & 16 deletions src/eval/Disambiguator.ml
Original file line number Diff line number Diff line change
Expand Up @@ -980,21 +980,8 @@ let run_with_args args =
in
let _ = OutputStateService.finalize () in

(* TODO: Make sure the ipc-generated state have the correct form for state output *)
match OutputStateService.get_full_state () with
| Ok state ->
(*
(* _balance is not availabe from IPC server, so use the one from the state file *)
let state_from_file =
parse_json args.input_state this_address
in
let balance =
List.find_exn state_from_file ~f:(fun (fname, _, _) ->
OutputName.equal fname ContractUtil.balance_label)
in
balance ::
*)
state
| Ok state -> state
| Error e -> fatal_error e
in
(init, state)
Expand All @@ -1014,10 +1001,9 @@ let run args ~exe_name =
let args = parse args ~exe_name in
let result_init, result_state = run_with_args args in
let init_str = output_to_string result_init in
let state_str = output_to_string result_state in
Out_channel.with_file args.output_init ~f:(fun ch ->
Out_channel.output_string ch init_str);
if not (String.is_empty args.output_state) then
Out_channel.with_file args.output_state ~f:(fun ch ->
Out_channel.output_string ch state_str);
Out_channel.output_string ch (output_to_string result_state));
"\"Disambiguate successful\""