compiler: Fixed Documentor, CodeEditor not building because of '(uint)&((Symbol)0...
authorJerome St-Louis <jerome@ecere.com>
Wed, 14 Sep 2011 18:29:53 +0000 (14:29 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 14 Sep 2011 18:29:53 +0000 (14:29 -0400)
compiler/libec/src/pass15.ec

index 488d300..e7cfa3e 100644 (file)
@@ -3755,11 +3755,15 @@ bool MatchTypeExpression(Expression sourceExp, Type dest, OldList conversions, b
                sourceExp.expType = null;
                ProcessExpressionType(sourceExp);
 
-               FreeType(sourceExp.expType);
-               sourceExp.expType = dest;
+               // In Debugger, this helps with addresses (e.g. null pointers) that end up casted to a void *: keeps a classType instead of a pointerType
+               if(!inCompiler)
+               {
+                  FreeType(sourceExp.expType);
+                  sourceExp.expType = dest;
+               }
 
                FreeType(source);
-               // FreeType(dest);
+               if(inCompiler) FreeType(dest);
 
                return true;
             }