summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Blake <ebb9@byu.net>2008-05-07 10:55:33 -0600
committerEric Blake <ebb9@byu.net>2008-05-07 10:55:33 -0600
commitc8a2c296df00c2e8b1b3b0372cea10d0d0a0b621 (patch)
tree5898c9d1b0cb9d1438ab4753b682dcc3eb76d9d6
parent50fabc46c235da6682f1bd76b1b43151e147c7bc (diff)
downloadm4-c8a2c296df00c2e8b1b3b0372cea10d0d0a0b621.tar.gz
Fix traceon regression introduced 2006-06-06.
* src/builtin.m4 (traceon): Only perform insertion if lookup fails. * doc/m4.texinfo (Trace): Test for the bug. * NEWS: Document it. Signed-off-by: Eric Blake <ebb9@byu.net>
-rw-r--r--ChangeLog8
-rw-r--r--NEWS4
-rw-r--r--doc/m4.texinfo10
-rw-r--r--src/builtin.c4
4 files changed, 25 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 91c18458..d5b23b6d 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,11 @@
+2008-05-07 Eric Blake <ebb9@byu.net>
+
+ Fix traceon regression introduced 2006-06-06.
+ * src/builtin.m4 (traceon): Only perform insertion if lookup
+ fails.
+ * doc/m4.texinfo (Trace): Test for the bug.
+ * NEWS: Document it.
+
2008-05-05 Eric Blake <ebb9@byu.net>
Stage 22: allow builtin token concatenation outside $@.
diff --git a/NEWS b/NEWS
index 052cbbc6..9bde89ca 100644
--- a/NEWS
+++ b/NEWS
@@ -5,6 +5,10 @@ Foundation, Inc.
* Noteworthy changes in Version 1.6 (????-??-??) [stable]
Released by ????, based on git version 1.4.10b.x-*
+** Fix regression introduced in 1.4.4b where using `traceon' could delete
+ a macro. This was most noticeable with `traceon(`traceon')', but
+ would also happen in cases such as `foo(traceon(`foo'))'.
+
** Fix regression introduced in 1.4.10b (but not present in 1.4.11) where
using `builtin' or `indir' to perform nested `shift' calls triggered an
assertion failure.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index fd04622d..30db58af 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -3708,6 +3708,16 @@ does not transfer tracing status.
@example
$ @kbd{m4 -d}
+traceon(`traceon')
+@result{}
+traceon(`traceoff')
+@error{}m4trace: -1- traceon(`traceoff')
+@result{}
+traceoff(`traceoff')
+@error{}m4trace: -1- traceoff(`traceoff')
+@result{}
+traceoff(`traceon')
+@result{}
traceon(`eval', `m4_divnum')
@result{}
define(`m4_eval', defn(`eval'))
diff --git a/src/builtin.c b/src/builtin.c
index 8ce6cf7f..05497453 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -1672,7 +1672,9 @@ m4_traceon (struct obstack *obs, int argc, macro_arguments *argv)
m4_warn (0, me, _("invalid macro name ignored"));
continue;
}
- s = lookup_symbol (ARG (i), SYMBOL_INSERT);
+ s = lookup_symbol (ARG (i), SYMBOL_LOOKUP);
+ if (!s)
+ s = lookup_symbol (ARG (i), SYMBOL_INSERT);
set_trace (s, obs);
}
}