scc

simple C compiler
git clone git://git.2f30.org/scc
Log | Files | Refs | README | LICENSE

commit b3b6ae58bc48acb7f2712cdb1c64116ff2335d9f
parent 07e97c2b9b7d58eeb6b69b6611fed4ed6150c379
Author: Quentin Rameau <quinq@fifth.space>
Date:   Tue, 12 Jul 2016 18:45:33 +0200

[cc2-qbe] fix eval call with NULL in oreturn

Actually pass the resulting token to eval instead of trying to parse
it again an having a null pointer.

Diffstat:
Mcc2/parser.c | 5++---
1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/cc2/parser.c b/cc2/parser.c @@ -329,9 +329,8 @@ oreturn(char *token, union tokenop u) { Node *np = newnode(u.op); - token = strtok(NULL, "\t\n"); - if (token) - eval(strtok(NULL, "\t\n")); + if (token = strtok(NULL, "\t\n")) + eval(token); if (!empty()) np->left = pop(); push(np);