aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2020-02-09 21:34:19 +0200
committerArnold D. Robbins <arnold@skeeve.com>2020-02-09 21:34:19 +0200
commitec041138efb27d105b391d022300a782552efdd2 (patch)
treef5702beb2fb8a724fe0f8f2116a5591463d90c4b
parentd992f06bcbacb2c9432a19bb0d0641229aed6449 (diff)
downloadegawk-ec041138efb27d105b391d022300a782552efdd2.tar.gz
egawk-ec041138efb27d105b391d022300a782552efdd2.tar.bz2
egawk-ec041138efb27d105b391d022300a782552efdd2.zip
All @eval to work again after a syntax error.
-rw-r--r--ChangeLog3
-rw-r--r--debug.c6
2 files changed, 9 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 40c5626e..840fe133 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -3,6 +3,9 @@
* awkgram.y: Add lint check for assignment in condition to
if and for statements. Thanks to Jannick <thirdedition@gmx.net>
for the suggestion.
+ * debug.c (do_eval): Remove @eval from the symbol table if there
+ was a syntax error in the statement being evaluated. Thanks again
+ to Jannick, for the report.
2020-02-01 Arnold D. Robbins <arnold@skeeve.com>
diff --git a/debug.c b/debug.c
index 632d025e..44038ff9 100644
--- a/debug.c
+++ b/debug.c
@@ -5606,6 +5606,12 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
if (ret != 0) {
pop_context(); /* switch to prev context */
free_context(ctxt, false /* keep_globals */);
+
+ /* Remove @eval from FUNCTAB. */
+ NODE *s = make_string("@eval", 5);
+ (void) assoc_remove(func_table, s);
+ unref(s);
+
return false;
}