diff options
author | Jannis Harder <me@jix.one> | 2022-12-05 16:17:00 +0100 |
---|---|---|
committer | Jannis Harder <me@jix.one> | 2022-12-05 16:17:00 +0100 |
commit | a43356cb049fed7360acd60ac5aa01602d5809e1 (patch) | |
tree | 9f84ed649abb3b27d8019d28df1fc52a4e28f771 /kernel/yosys.cc | |
parent | 0f7b8b8d23b4f5ba6a4d0f37c821a8935cd0e508 (diff) | |
download | yosys-a43356cb049fed7360acd60ac5aa01602d5809e1.tar.gz yosys-a43356cb049fed7360acd60ac5aa01602d5809e1.tar.bz2 yosys-a43356cb049fed7360acd60ac5aa01602d5809e1.zip |
tcl: Unset both result.json and result.string only before calling pass
Diffstat (limited to 'kernel/yosys.cc')
-rw-r--r-- | kernel/yosys.cc | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/kernel/yosys.cc b/kernel/yosys.cc index 9ece3a2c0..69db9df66 100644 --- a/kernel/yosys.cc +++ b/kernel/yosys.cc @@ -773,6 +773,7 @@ static int tcl_yosys_cmd(ClientData, Tcl_Interp *interp, int argc, const char *a } yosys_get_design()->scratchpad_unset("result.json"); + yosys_get_design()->scratchpad_unset("result.string"); bool in_repl = yosys_tcl_repl_active; bool restore_log_cmd_error_throw = log_cmd_error_throw; @@ -811,12 +812,10 @@ static int tcl_yosys_cmd(ClientData, Tcl_Interp *interp, int argc, const char *a auto json = json11::Json::parse(result->second, err); if (err.empty()) { Tcl_SetObjResult(interp, json_to_tcl(interp, json)); - scratchpad.erase(result); } else log_warning("Ignoring result.json scratchpad value due to parse error: %s\n", err.c_str()); } else if ((result = scratchpad.find("result.string")) != scratchpad.end()) { Tcl_SetObjResult(interp, Tcl_NewStringObj(result->second.data(), result->second.size())); - scratchpad.erase(result); } return TCL_OK; |