aboutsummaryrefslogtreecommitdiff
path: root/gcc/incpath.c
diff options
context:
space:
mode:
authorPaolo Carlini <paolo.carlini@oracle.com>2011-11-09 17:26:37 +0000
committerPaolo Carlini <paolo@gcc.gnu.org>2011-11-09 17:26:37 +0000
commit9b5e84de9db21d613c12f6bf9d4907b8aae05242 (patch)
tree9221dcf165ed82113e5ea78e31f03e27b13da4a6 /gcc/incpath.c
parente8089b4a9d21a6bbd5f17443fde6335fecee3730 (diff)
downloadgcc-9b5e84de9db21d613c12f6bf9d4907b8aae05242.zip
gcc-9b5e84de9db21d613c12f6bf9d4907b8aae05242.tar.gz
gcc-9b5e84de9db21d613c12f6bf9d4907b8aae05242.tar.bz2
re PR preprocessor/51061 (Deprecated -I- option causes segfault)
2011-11-09 Paolo Carlini <paolo.carlini@oracle.com> PR preprocessor/51061 * incpath.c (merge_include_chains): Make sure to not pass null pointers to free_path. From-SVN: r181216
Diffstat (limited to 'gcc/incpath.c')
-rw-r--r--gcc/incpath.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/gcc/incpath.c b/gcc/incpath.c
index aab6e15..07a765f 100644
--- a/gcc/incpath.c
+++ b/gcc/incpath.c
@@ -362,8 +362,10 @@ merge_include_chains (const char *sysroot, cpp_reader *pfile, int verbose)
void
split_quote_chain (void)
{
- free_path (heads[QUOTE], REASON_QUIET);
- free_path (tails[QUOTE], REASON_QUIET);
+ if (heads[QUOTE])
+ free_path (heads[QUOTE], REASON_QUIET);
+ if (tails[QUOTE])
+ free_path (tails[QUOTE], REASON_QUIET);
heads[QUOTE] = heads[BRACKET];
tails[QUOTE] = tails[BRACKET];
heads[BRACKET] = NULL;