compiler/libec (ide): Fixed crash on null expression type
authorJerome St-Louis <jerome@ecere.com>
Sun, 13 Jul 2014 05:21:12 +0000 (01:21 -0400)
committerJerome St-Louis <jerome@ecere.com>
Sun, 13 Jul 2014 05:24:12 +0000 (01:24 -0400)
- Fixed a crash parsing: position = { Max(p, 1) };

compiler/bootstrap/libec/bootstrap/pass15.c
compiler/libec/src/pass15.ec

index 8a060a5..969e712 100644 (file)
@@ -18835,7 +18835,7 @@ struct Expression * nbExp = GetNonBracketsExp(exp);
 unsigned int skipWarning = 0;
 int kind = exp->destType->kind;
 
-if(nbExp->type == 12 && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
+if(nbExp->type == 12 && nbExp->destType && !nbExp->destType->casted && nbExp->destType->kind == exp->destType->kind)
 skipWarning = 1;
 if((kind == 1 || kind == 2) && exp->destType->isSigned == exp->expType->signedBeforePromotion && nbExp->type == 4 && nbExp->__anon1.op.exp1 && nbExp->__anon1.op.exp2)
 {
index 5493f18..2c584d9 100644 (file)
@@ -11263,7 +11263,7 @@ void ProcessExpressionType(Expression exp)
                   Expression nbExp = GetNonBracketsExp(exp);
                   bool skipWarning = false;
                   TypeKind kind = exp.destType.kind;
-                  if(nbExp.type == conditionExp && !nbExp.destType.casted && nbExp.destType.kind == exp.destType.kind)
+                  if(nbExp.type == conditionExp && nbExp.destType && !nbExp.destType.casted && nbExp.destType.kind == exp.destType.kind)
                      // The if/else operands have already been checked / warned about
                      skipWarning = true;
                   if((kind == charType || kind == shortType) && exp.destType.isSigned == exp.expType.signedBeforePromotion && nbExp.type == opExp && nbExp.op.exp1 && nbExp.op.exp2)