ide/debugger/watches: Fixed crashes on operators with only a right operand
authorJerome St-Louis <jerome@ecere.com>
Thu, 22 May 2014 14:25:04 +0000 (10:25 -0400)
committerJerome St-Louis <jerome@ecere.com>
Thu, 22 May 2014 14:25:04 +0000 (10:25 -0400)
- Was using unitialized memory, not computing operand

ide/src/debugger/debugTools.ec

index a977781..8e8a2c5 100644 (file)
@@ -826,7 +826,7 @@ void DebugComputeExpression(Expression exp)
       case opExp:
       {
          Expression expError = null;
-         Expression exp1, exp2 = null;
+         Expression exp1 = null, exp2 = null;
          Operand op1 = { 0 }, op2 = { 0 };
 
          /*
@@ -957,6 +957,12 @@ void DebugComputeExpression(Expression exp)
                         if(op2.type) op2.type.refCount++;
                      }
                   }
+                  else
+                  {
+                     exp1 = exp.op.exp1;
+                     op1 = GetOperand(exp1);
+                     if(op1.type) op1.type.refCount++;
+                  }
                }
             }
             else if(exp.op.exp2)