diff options
author | Zack Weinberg <zackw@panix.com> | 2020-12-07 11:32:55 -0500 |
---|---|---|
committer | Zack Weinberg <zackw@panix.com> | 2020-12-07 11:32:55 -0500 |
commit | b4ec547b86e6dd878d312cc79dddabce825a4492 (patch) | |
tree | 9a25d07b55e57b5d21f862600a682c290876673b /bin | |
parent | fbd2636f3db4578f3ccab42728feee57b1f8c5e2 (diff) | |
download | autoconf-b4ec547b86e6dd878d312cc79dddabce825a4492.tar.gz |
autom4te: don’t crash when warnings have no stacktrace
In testing on Darwin (OSX), sometimes warnings reported from M4 code
reach autom4te with no stack trace at all, causing the perl script to
crash with a “use of uninitialized value” error. The root cause of
the problem is not clear to me, but the script certainly shouldn’t
crash.
Problem found by Jannick <thirdedition@gmx.net>.
* bin/autom4te.in: When processing warnings, make sure $stacktrace is
defined.
Diffstat (limited to 'bin')
-rw-r--r-- | bin/autom4te.in | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/bin/autom4te.in b/bin/autom4te.in index e54fa145..febcdeea 100644 --- a/bin/autom4te.in +++ b/bin/autom4te.in @@ -1068,6 +1068,8 @@ for (split (/\n*$separator\n*/o, contents ("$tmp/warnings"))) # In particular, m4_warn guarantees that either $stackdump is empty, or # it consists of lines where only the last line ends in "top level". my ($cat, $loc, $msg, $stacktrace) = split ('::', $_, 4); + # There might not have been a stacktrace. + $stacktrace = '' unless defined $stacktrace; msg $cat, $loc, $msg, partial => ($stacktrace =~ /top level$/) + 0; for (split /\n/, $stacktrace) |