compiler/libec/pass15: Fix for using ^ (binary XOR) operator with enum values without...
authorJerome St-Louis <jerome@ecere.com>
Tue, 1 Jul 2014 07:32:13 +0000 (03:32 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 1 Jul 2014 07:32:13 +0000 (03:32 -0400)
compiler/bootstrap/libec/bootstrap/pass15.c
compiler/libec/src/pass15.ec

index d06a4b1..e402fe2 100644 (file)
@@ -15831,7 +15831,7 @@ exp->__anon1.op.exp1->expType->refCount++;
 else
 {
 exp->__anon1.op.exp2->destType = exp->destType;
-if(!exp->__anon1.op.exp1 || exp->__anon1.op.op != '&')
+if(!exp->__anon1.op.exp1 || (exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^'))
 exp->__anon1.op.exp2->opDestType = 1;
 if(exp->destType)
 exp->destType->refCount++;
@@ -15879,7 +15879,7 @@ else if(destClass && ((destClass->type == 3 && useDestType && useSideUnit) || (d
 if(exp->__anon1.op.exp2->destType)
 FreeType(exp->__anon1.op.exp2->destType);
 exp->__anon1.op.exp2->destType = exp->destType;
-if(exp->__anon1.op.op != '&')
+if(exp->__anon1.op.op != '&' && exp->__anon1.op.op != '^')
 exp->__anon1.op.exp2->opDestType = 1;
 if(exp->destType)
 exp->destType->refCount++;
index f76f8c2..a9164fc 100644 (file)
@@ -8371,7 +8371,7 @@ void ProcessExpressionType(Expression exp)
                else
                {
                   exp.op.exp2.destType = exp.destType;
-                  if(!exp.op.exp1 || exp.op.op != '&')
+                  if(!exp.op.exp1 || (exp.op.op != '&' && exp.op.op != '^'))
                      exp.op.exp2.opDestType = true;
                   if(exp.destType)
                      exp.destType.refCount++;
@@ -8420,7 +8420,7 @@ void ProcessExpressionType(Expression exp)
             {
                if(exp.op.exp2.destType) FreeType(exp.op.exp2.destType);
                exp.op.exp2.destType = exp.destType;
-               if(exp.op.op != '&')
+               if(exp.op.op != '&' && exp.op.op != '^')
                   exp.op.exp2.opDestType = true;
                if(exp.destType)
                   exp.destType.refCount++;