ide(compiler/libec): Fixed watch crash on any_object
authorJerome St-Louis <jerome@ecere.com>
Fri, 3 May 2013 17:48:25 +0000 (13:48 -0400)
committerJerome St-Louis <jerome@ecere.com>
Fri, 3 May 2013 17:48:25 +0000 (13:48 -0400)
- ApplyAnyObjectLogic should not have been called

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

index f13f1cd..e33e0b7 100644 (file)
@@ -12141,12 +12141,12 @@ PrintTypeNoConst(e->expType, typeString, 0x0, 0x1);
 decl = SpecDeclFromString(typeString, specs, (((void *)0)));
 newExp->destType = ProcessType(specs, decl);
 curContext = context;
-e->type = 25;
 if(curCompound)
 {
 char name[100];
 struct __ecereNameSpace__ecere__sys__OldList * stmts = MkList();
 
+e->type = 25;
 sprintf(name, "__internalValue%03X", internalValueCounter++);
 if(!curCompound->compound.declarations)
 curCompound->compound.declarations = MkList();
@@ -15084,6 +15084,7 @@ __ecereNameSpace__ecere__sys__ChangeCh(expString, '\n', ' ');
 }
 Compiler_Error(__ecereNameSpace__ecere__GetTranslatedString(__thisModule, "couldn't determine type of %s\n", (((void *)0))), expString);
 }
+if(inCompiler)
 ApplyAnyObjectLogic(exp);
 if(!notByReference && exp->expType && exp->expType->kind == 8 && exp->expType->_class && exp->expType->_class->registered && exp->expType->_class->registered->type == 5 && (!exp->destType || (exp->destType->kind != 3 && exp->destType->kind != 4 && exp->destType->kind != 22 && exp->destType->kind != 23 && exp->destType->kind != 5 && exp->destType->kind != 2 && exp->destType->kind != 1)))
 {
index df01c07..f15b31d 100644 (file)
@@ -31,12 +31,12 @@ msgstr ":%d:%d: warning: "
 msgid "Array size not constant int (%s)\n"
 msgstr "Array size not constant int (%s)\n"
 
-#: ./src/pass15.ec:10508
+#: ./src/pass15.ec:10509
 msgid "Assigning list initializer to non list\n"
 msgstr "Assigning list initializer to non list\n"
 
 #: ./src/pass15.ec:10174
-#: ./src/pass15.ec:11220
+#: ./src/pass15.ec:11221
 msgid "Couldn't determine type of array elements\n"
 msgstr "Couldn't determine type of array elements\n"
 
@@ -52,7 +52,7 @@ msgstr "Couldn't open %s\n"
 msgid "Expecting class specifier\n"
 msgstr "Expecting class specifier\n"
 
-#: ./src/pass15.ec:11378
+#: ./src/pass15.ec:11379
 msgid "Expression is not a container\n"
 msgstr "Expression is not a container\n"
 
@@ -64,12 +64,12 @@ msgstr "Includes nested too deeply"
 msgid "Incompatible virtual function %s\n"
 msgstr "Incompatible virtual function %s\n"
 
-#: ./src/pass15.ec:11652
-#: ./src/pass15.ec:11727
+#: ./src/pass15.ec:11653
+#: ./src/pass15.ec:11728
 msgid "Invalid object specified and not inside a class\n"
 msgstr "Invalid object specified and not inside a class\n"
 
-#: ./src/pass15.ec:11560
+#: ./src/pass15.ec:11561
 msgid "Invalid watched object\n"
 msgstr "Invalid watched object\n"
 
@@ -94,11 +94,11 @@ msgstr "Multiple field index requires a name\n"
 msgid "No database table defined in this module or database_open already used.\n"
 msgstr "No database table defined in this module or database_open already used.\n"
 
-#: ./src/pass15.ec:11573
+#: ./src/pass15.ec:11574
 msgid "No observer specified and not inside a _class\n"
 msgstr "No observer specified and not inside a _class\n"
 
-#: ./src/pass15.ec:11730
+#: ./src/pass15.ec:11731
 msgid "No observer specified and not inside a class\n"
 msgstr "No observer specified and not inside a class\n"
 
@@ -112,9 +112,9 @@ msgid "Non-static %s making use of a static class\n"
 msgstr "Non-static %s making use of a static class\n"
 
 #: ./src/pass1.ec:1037
-#: ./src/pass15.ec:11555
-#: ./src/pass15.ec:11627
-#: ./src/pass15.ec:11716
+#: ./src/pass15.ec:11556
+#: ./src/pass15.ec:11628
+#: ./src/pass15.ec:11717
 msgid "Property %s not found in class %s\n"
 msgstr "Property %s not found in class %s\n"
 
index b790ca6..76fff00 100644 (file)
@@ -6999,13 +6999,13 @@ void ApplyAnyObjectLogic(Expression e)
                         newExp.destType = ProcessType(specs, decl);
 
                         curContext = context;
-                        e.type = extensionCompoundExp;
 
                         // We need a current compound for this
                         if(curCompound)
                         {
                            char name[100];
                            OldList * stmts = MkList();
+                           e.type = extensionCompoundExp;
                            sprintf(name, "__internalValue%03X", internalValueCounter++);
                            if(!curCompound.compound.declarations)
                               curCompound.compound.declarations = MkList();
@@ -10338,7 +10338,8 @@ void ProcessExpressionType(Expression exp)
    }
 
    // Let's try to support any_object & typed_object here:
-   ApplyAnyObjectLogic(exp);
+   if(inCompiler)
+      ApplyAnyObjectLogic(exp);
 
    // Mark nohead classes as by reference, unless we're casting them to an integral type
    if(!notByReference && exp.expType && exp.expType.kind == classType && exp.expType._class && exp.expType._class.registered &&