scc

simple c99 compiler
git clone git://git.simple-cc.org/scc
Log | Files | Refs | Submodules | README | LICENSE

commit badf250751e7443df7f671a7cf29a9151d04ca91
parent 29bbd53de044cd344081fcd46d8b7bdd0bcb2201
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 14 Jun 2016 12:17:01 +0200

[cc1] Avoid error with macros without pattern

A macro can be defined and not have a replacement string
so we have to test this case and don't try to expand
a NULL string.

Diffstat:
Mcc1/cpp.c | 2++
1 file changed, 2 insertions(+), 0 deletions(-)

diff --git a/cc1/cpp.c b/cc1/cpp.c @@ -255,6 +255,8 @@ expand(char *begin, Symbol *sym) elen = sprintf(buffer, "%d ", input->nline); goto substitute; } + if (!s) + return 1; if (!parsepars(arguments, arglist, atoi(s))) return 0;