summaryrefslogtreecommitdiff
path: root/gcc/cccp.c
diff options
context:
space:
mode:
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-29 19:41:47 +0000
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>1995-04-29 19:41:47 +0000
commit8ac6cf661c9346d7586f75c8ea80460b6fd3404d (patch)
tree7b13bd2876df745b5523a36039df4993a51ba967 /gcc/cccp.c
parentd178f670bf8faa385a62843902f1ac1eb84eea40 (diff)
downloadgcc-8ac6cf661c9346d7586f75c8ea80460b6fd3404d.tar.gz
(macarg): Except for reporting error, treat unterminated macro call as
if it were terminated, since `macroexpand' relies on *argptr being filled in. git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@9543 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'gcc/cccp.c')
-rw-r--r--gcc/cccp.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/gcc/cccp.c b/gcc/cccp.c
index 88341636989..7c49e4d139a 100644
--- a/gcc/cccp.c
+++ b/gcc/cccp.c
@@ -8429,6 +8429,7 @@ macarg (argptr, rest_args)
int paren = 0;
int newlines = 0;
int comments = 0;
+ char *result = 0;
/* Try to parse as much of the argument as exists at this
input stack level. */
@@ -8461,8 +8462,8 @@ macarg (argptr, rest_args)
while (bp == ip->buf + ip->length) {
if (instack[indepth].macro == 0) {
- free (buffer);
- return "unterminated macro call";
+ result = "unterminated macro call";
+ break;
}
ip->macro->type = T_MACRO;
if (ip->free_ptr)
@@ -8538,7 +8539,7 @@ macarg (argptr, rest_args)
}
argptr->stringified_length = totlen;
}
- return 0;
+ return result;
}
/* Scan text from START (inclusive) up to LIMIT (exclusive),