summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRoland McGrath <roland@redhat.com>1994-04-21 03:48:00 +0000
committerRoland McGrath <roland@redhat.com>1994-04-21 03:48:00 +0000
commitf6716d5e74d06e2c24ee1b2935fe17c576d39b4c (patch)
tree77ff47b12c42ce6349e3d9c46a505fdcf01931fb
parentbe451f6d290c3adfe4d2c72000864e41b5979fdb (diff)
downloadgunmake-f6716d5e74d06e2c24ee1b2935fe17c576d39b4c.tar.gz
(pattern_search): Always allocate new storage for FILE->stem.
It is not safe to store STEM's address because it might be auto storage.
-rw-r--r--implicit.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/implicit.c b/implicit.c
index 64cf1a3..4806f6a 100644
--- a/implicit.c
+++ b/implicit.c
@@ -1,5 +1,5 @@
/* Implicit rule searching for GNU Make.
-Copyright (C) 1988, 1989, 1990, 1991, 1992, 1993 Free Software Foundation, Inc.
+Copyright (C) 1988, 89, 90, 91, 92, 93, 94 Free Software Foundation, Inc.
This file is part of GNU Make.
GNU Make is free software; you can redistribute it and/or modify
@@ -547,7 +547,9 @@ pattern_search (file, archive, depth, recursions)
}
if (!checked_lastslash[foundrule])
- file->stem = stem[stemlen] == '\0' ? stem : savestring (stem, stemlen);
+ /* Always allocate new storage, since STEM might be
+ on the stack for an intermediate file. */
+ file->stem = savestring (stem, stemlen);
else
{
/* We want to prepend the directory from