From 12f54b9f87d40cb08130b1602654e5592a8a9fa6 Mon Sep 17 00:00:00 2001 From: Jerome St-Louis Date: Wed, 6 Aug 2014 18:54:08 -0400 Subject: [PATCH] compiler/libec: Fixed disappearing cast on units within brackets - Radians b = Degrees { 30 }; int ixX = (int)(b); --- compiler/bootstrap/libec/bootstrap/pass15.c | 1 + compiler/libec/src/pass15.ec | 1 + 2 files changed, 2 insertions(+) diff --git a/compiler/bootstrap/libec/bootstrap/pass15.c b/compiler/bootstrap/libec/bootstrap/pass15.c index cdddb48..3bc7da5 100644 --- a/compiler/bootstrap/libec/bootstrap/pass15.c +++ b/compiler/bootstrap/libec/bootstrap/pass15.c @@ -17070,6 +17070,7 @@ if(!exp->expType && !e->next) exp->expType = e->expType; if(e->expType) e->expType->refCount++; +exp->needCast = e->needCast; } if(!e->isConstant) exp->isConstant = 0; diff --git a/compiler/libec/src/pass15.ec b/compiler/libec/src/pass15.ec index 11d2ef1..edb9e63 100644 --- a/compiler/libec/src/pass15.ec +++ b/compiler/libec/src/pass15.ec @@ -9250,6 +9250,7 @@ void ProcessExpressionType(Expression exp) { exp.expType = e.expType; if(e.expType) e.expType.refCount++; + exp.needCast = e.needCast; } if(!e.isConstant) exp.isConstant = false; -- 1.8.3.1