Merge pull request #266 from tkchia/tkchia/20220802
Fix cpp.ansi crash when stringifying missing macro argument
This commit is contained in:
commit
86ded9ea2c
|
@ -706,6 +706,8 @@ static char *stringify(
|
|||
assert(n != 0);
|
||||
p = args->a_rawvec[n-1];
|
||||
add2repl(repl, '"');
|
||||
|
||||
if (p) {
|
||||
while (*p) {
|
||||
if (is_wsp(*p)) {
|
||||
if (!space) {
|
||||
|
@ -732,6 +734,8 @@ static char *stringify(
|
|||
for (--repl->r_ptr; is_wsp(*repl->r_ptr); repl->r_ptr--)
|
||||
/* EMPTY */;
|
||||
++repl->r_ptr; /* oops, one to far */
|
||||
}
|
||||
|
||||
add2repl(repl, '"');
|
||||
} else
|
||||
error("illegal use of # operator");
|
||||
|
|
Loading…
Reference in a new issue