From 31fbf910af3750434855b4316a3eb16c4d3fcbc7 Mon Sep 17 00:00:00 2001 From: Holger Vogt Date: Mon, 21 Jun 2021 18:26:23 +0200 Subject: [PATCH] Crash when trying to delete root and netlist: Revert the order of deletion: Firstly the root, then the netlist. --- src/frontend/inpcom.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/frontend/inpcom.c b/src/frontend/inpcom.c index adea8b7fb..bef126e7c 100644 --- a/src/frontend/inpcom.c +++ b/src/frontend/inpcom.c @@ -887,8 +887,8 @@ struct card *inp_readall(FILE *fp, const char *dir_name, inp_add_control_section(working, &rv.line_number); #ifdef XSPICE if (inp_poly_2g6_compat(working)) { - line_free_x(cc, TRUE); inp_rem_levels(root); + line_free_x(cc, TRUE); return NULL; } #else @@ -9671,6 +9671,8 @@ static int inp_poly_2g6_compat(struct card* deck) { curr_line = nexttok_noparens(curr_line); curr_line = nexttok_noparens(curr_line); curr_line = nexttok_noparens(curr_line); + if (!curr_line) + return 1; /* exclude all of the following fourth tokens */ if (ciprefix("poly", curr_line)) continue;