From 13ed014d926c32235ff7ebf160cb890700fdb13f Mon Sep 17 00:00:00 2001 From: "Gary V. Vaughan" Date: Sun, 4 Dec 2005 20:17:36 +0000 Subject: [PATCH] * input.c (match_input): Do not pass expression with side effect to `obstack_grow'. Fix . * NEWS: Updated. --- ChangeLog | 8 +++++++- NEWS | 4 ++++ src/input.c | 7 ++++++- 3 files changed, 17 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index 95cf431a..35b7851d 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,4 +1,10 @@ -2005-12-04 Gary V. Vaughan (tiny change) +2005-12-04 Ilya N. Golubev (tiny change) + + * input.c (match_input): Do not pass expression with side effect + to `obstack_grow'. Fix . + * NEWS: Updated. + +2005-12-04 Gary V. Vaughan (tiny change) * doc/m4.texinfo (How to debug macros and input): s/woould/would/ Reported by Damian Menscher diff --git a/NEWS b/NEWS index 914621dc..641cb278 100644 --- a/NEWS +++ b/NEWS @@ -1,6 +1,10 @@ GNU m4 NEWS - User visible changes. Copyright (C) 1992, 1993, 1994, 2004, 2005 Free Software Foundation, Inc. +Version 1.4.5 - ??? 200?, by ??? + +* Fix a recursive push_string crashing bug. + Version 1.4.4 - October 2005, by Gary V. Vaughan * ./configure --infodir=/usr/share/info now works correctly. diff --git a/src/input.c b/src/input.c index 12e1e5dc..ec778d1c 100644 --- a/src/input.c +++ b/src/input.c @@ -531,7 +531,12 @@ match_input (const char *s) } /* Failed, push back input. */ - obstack_grow (push_string_init (), t, n); + { + struct obstack *h = push_string_init (); + + /* `obstack_grow' may be macro evaluating its arg 1 several times. */ + obstack_grow (h, t, n); + } push_string_finish (); return 0; } -- 2.11.4.GIT