m4-patches
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

regression on traceon(undef)defn(undef)


From: Eric Blake
Subject: regression on traceon(undef)defn(undef)
Date: Thu, 21 Aug 2008 06:51:40 -0600
User-agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.1.16) Gecko/20080708 Thunderbird/2.0.0.16 Mnenhy/0.7.5.666

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

What's worse, this is eerily similar to the bug I fixed for 1.4.5:
  echo 'indir(undef)' | m4 -t undef
I failed to add enough to the testsuite back then when I first realized
that traced but undefined symbols must be gracefully handled.  Both 1.4.11
and 1.4.10b are impacted.  Fortunately, this bug doesn't affect the master
branch, nor will it be tripped by clients like autoconf which always check
ifdef prior to defn.

- --
Don't work too hard, make some time for fun as well!

Eric Blake             address@hidden
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Public key at home.comcast.net/~ericblake/eblake.gpg
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkitZNwACgkQ84KuGfSFAYCEqACgrRaNQhyJVIytG1xEnEnVPEFg
pFcAn3/X94Hg+CPz5fpPIiIyify0YysJ
=KZve
-----END PGP SIGNATURE-----
>From 349bbb7400ee079878cb5859ee850a2b34a74c40 Mon Sep 17 00:00:00 2001
From: Eric Blake <address@hidden>
Date: Thu, 21 Aug 2008 06:50:50 -0600
Subject: [PATCH] Fix crash with traced defn(undef), regression from 2007-08-09.

* src/builtin.c (m4_defn): Handle traced but undefined macros.
* doc/m4.texinfo (Trace): Test it.
* NEWS: Document it.

Signed-off-by: Eric Blake <address@hidden>
---
 ChangeLog      |    7 +++++++
 doc/m4.texinfo |    4 +++-
 src/builtin.c  |    4 ++++
 3 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index 51b3165..8c55d2a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2008-08-21  Eric Blake  <address@hidden>
+
+       Fix crash with traced defn(undef), regression from 2007-08-09.
+       * src/builtin.c (m4_defn): Handle traced but undefined macros.
+       * doc/m4.texinfo (Trace): Test it.
+       * NEWS: Document it.
+
 2008-08-18  Eric Blake  <address@hidden>
 
        Fix crash with 'm4 -N9', regression from 2006-09-14.
diff --git a/doc/m4.texinfo b/doc/m4.texinfo
index d232c36..8ec4478 100644
--- a/doc/m4.texinfo
+++ b/doc/m4.texinfo
@@ -3553,6 +3553,8 @@ Trace
 @result{}
 foo
 @result{}foo
+defn(`foo')
address@hidden
 define(`foo', `bar')
 @result{}
 foo
@@ -3563,7 +3565,7 @@ Trace
 ifdef(`foo', `yes', `no')
 @result{}no
 indir(`foo')
address@hidden:stdin:8: undefined macro `foo'
address@hidden:stdin:9: undefined macro `foo'
 @result{}
 define(`foo', `blah')
 @result{}
diff --git a/src/builtin.c b/src/builtin.c
index 450b725..5ea886d 100644
--- a/src/builtin.c
+++ b/src/builtin.c
@@ -922,6 +922,10 @@ builtin `%s' requested by frozen file is not supported", 
ARG (i)));
            push_macro (b);
          break;
 
+       case TOKEN_VOID:
+         /* Nothing to do for traced but undefined macro.  */
+         break;
+
        default:
          M4ERROR ((warning_status, 0,
                    "INTERNAL ERROR: bad symbol type in m4_defn ()"));
-- 
1.6.0


reply via email to

[Prev in Thread] Current Thread [Next in Thread]