diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | debug.c | 21 | ||||
-rw-r--r-- | symbol.c | 2 | ||||
-rw-r--r-- | test/ChangeLog | 5 | ||||
-rw-r--r-- | test/Makefile.am | 8 | ||||
-rw-r--r-- | test/Makefile.in | 8 | ||||
-rw-r--r-- | test/dbugeval.in | 2 | ||||
-rw-r--r-- | test/dbugeval.ok | 1 |
8 files changed, 41 insertions, 12 deletions
@@ -1,3 +1,9 @@ +2014-05-11 Arnold D. Robbins <arnold@skeeve.com> + + * debug.c (do_eval): Repair fix of 2014-05-09 and use + assoc_remove to take @eval out of the function table. + * symbol.c: Fix a comment. This file needs some work. + 2014-05-10 Arnold D. Robbins <arnold@skeeve.com> * io.c (get_a_record): Finish TERMNEAREND handling in case @@ -5560,21 +5560,24 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED) this_func->param_cnt -= ecount; } - /* always destroy symbol "@eval", however destroy all newly installed + /* + * Always destroy symbol "@eval", however destroy all newly installed * globals only if fatal error (execute_code() returing NULL). */ pop_context(); /* switch to prev context */ free_context(ctxt, (ret_val != NULL)); /* free all instructions and optionally symbols */ - /* - * May 2014: - * Don't do this. f points into the context we just released. - * Only showed up on Fedora 20 / Ubuntu 14.04. - * - * if (ret_val != NULL) - * destroy_symbol(f); // destroy "@eval" - */ + if (ret_val != NULL) { + /* + * Remove @eval from FUNCTAB, so that above code + * will work the next time around. + */ + NODE *s = make_string("@eval", 5); + + (void) assoc_remove(func_table, s); + unref(s); + } free_srcfile(the_source); @@ -508,7 +508,7 @@ append_symbol(NODE *r) symbol_list->rnode = p; } -/* release_symbol --- free symbol list and optionally remove symbol from symbol table */ +/* release_symbols --- free symbol list and optionally remove symbol from symbol table */ void release_symbols(NODE *symlist, int keep_globals) diff --git a/test/ChangeLog b/test/ChangeLog index 095fe155..b5800961 100644 --- a/test/ChangeLog +++ b/test/ChangeLog @@ -1,3 +1,8 @@ +2014-05-11 Arnold D. Robbins <arnold@skeeve.com> + + * Makefile.am (dbugeval): New test. + * dbugeval.in, dbugeval.ok: New files. + 2014-05-10 Andrew J. Schorr <aschorr@telemetry-investments.com> * Makefile.am (rsglstdin): New test. diff --git a/test/Makefile.am b/test/Makefile.am index 260b216a..574ca2ea 100644 --- a/test/Makefile.am +++ b/test/Makefile.am @@ -167,6 +167,7 @@ EXTRA_DIST = \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ defref.awk \ defref.ok \ delargv.awk \ @@ -990,7 +991,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -1928,6 +1929,11 @@ backsmalls2: AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ +dbugeval:: + @echo $@ + $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + # Targets generated for other tests: include Maketests diff --git a/test/Makefile.in b/test/Makefile.in index 34d5c594..595e4966 100644 --- a/test/Makefile.in +++ b/test/Makefile.in @@ -413,6 +413,7 @@ EXTRA_DIST = \ datanonl.awk \ datanonl.in \ datanonl.ok \ + dbugeval.in \ defref.awk \ defref.ok \ delargv.awk \ @@ -1235,7 +1236,7 @@ UNIX_TESTS = \ GAWK_EXT_TESTS = \ aadelete1 aadelete2 aarray1 aasort aasorti argtest arraysort \ backw badargs beginfile1 beginfile2 binmode1 charasbytes \ - colonwarn clos1way delsub devfd devfd1 devfd2 dumpvars exit \ + colonwarn clos1way dbugeval delsub devfd devfd1 devfd2 dumpvars exit \ fieldwdth fpat1 fpat2 fpat3 fpatnull fsfwfs funlen \ functab1 functab2 functab3 fwtest fwtest2 fwtest3 \ gensub gensub2 getlndir gnuops2 gnuops3 gnureops \ @@ -2351,6 +2352,11 @@ backsmalls2: @[ -z "$$GAWKLOCALE" ] && GAWKLOCALE=en_US.UTF-8; \ AWKPATH="$(srcdir)" $(AWK) -f $@.awk "$(srcdir)"/$@.in >_$@ 2>&1 || echo EXIT CODE: $$? >>_$@ @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ + +dbugeval:: + @echo $@ + $(AWK) --debug -f /dev/null < "$(srcdir)"/$@.in > _$@ 2>&1 || echo EXIT CODE: $$? >>_$@ + @-$(CMP) "$(srcdir)"/$@.ok _$@ && rm -f _$@ Gt-dummy: # file Maketests, generated from Makefile.am by the Gentests program addcomma: diff --git a/test/dbugeval.in b/test/dbugeval.in new file mode 100644 index 00000000..6a3c2459 --- /dev/null +++ b/test/dbugeval.in @@ -0,0 +1,2 @@ +eval "" +eval "" diff --git a/test/dbugeval.ok b/test/dbugeval.ok new file mode 100644 index 00000000..284f2abb --- /dev/null +++ b/test/dbugeval.ok @@ -0,0 +1 @@ +EXIT CODE: 2 |