shithub: scc

Download patch

ref: cefd4d922b235966f6777c98de15c020876534ba
parent: 194e484541a9d7dd7894eb1e418c4486f71daeb1
author: Roberto E. Vargas Caballero <[email protected]>
date: Tue Apr 22 07:11:50 EDT 2014

Eval expression before casting it

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

--- a/expr.c
+++ b/expr.c
@@ -509,7 +509,7 @@
 			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;