scc

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

commit cefd4d922b235966f6777c98de15c020876534ba
parent 194e484541a9d7dd7894eb1e418c4486f71daeb1
Author: Roberto E. Vargas Caballero <k0ga@shike2.com>
Date:   Tue, 22 Apr 2014 11:11:50 +0200

Eval expression before casting it

cast() only cannot deal with comparisions, so parameter expression
must be evaluated before casting it.

Diffstat:
Mexpr.c | 2+-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/expr.c b/expr.c @@ -509,7 +509,7 @@ cast(void) next(); tp = typename(); expect(')'); - np1 = cast(); + np1 = eval(cast()); if ((np2 = convert(np1, tp, 1)) == NULL) error("bad type convertion requested"); np2->b.lvalue = np1->b.lvalue;