compiler/libec: Fixed indirection level on non-typed object virtual call
authorJerome St-Louis <jerome@ecere.com>
Tue, 10 Jun 2014 23:13:06 +0000 (19:13 -0400)
committerJerome St-Louis <jerome@ecere.com>
Tue, 10 Jun 2014 23:13:06 +0000 (19:13 -0400)
- Correction to e9e01f2469c7146caee71e28071701886d78846c

compiler/bootstrap/libec/bootstrap/pass1.c
compiler/bootstrap/libec/bootstrap/pass2.c
compiler/libec/src/pass2.ec

index f76e42e..81d9f80 100644 (file)
@@ -2891,7 +2891,7 @@ extern void FreeIdentifier(struct Identifier * id);
 
 void __ecereDestructor_ClassPropertyValue(struct __ecereNameSpace__ecere__com__Instance * this)
 {
-struct ClassPropertyValue * __ecerePointer_ClassPropertyValue = (struct ClassPropertyValue *)(this ? (((char *)this) + __ecereClass_ClassPropertyValue->offset) : 0);
+__attribute__((unused)) struct ClassPropertyValue * __ecerePointer_ClassPropertyValue = (struct ClassPropertyValue *)(this ? (((char *)this) + __ecereClass_ClassPropertyValue->offset) : 0);
 
 {
 FreeIdentifier(__ecerePointer_ClassPropertyValue->id);
index 158011d..b58b34c 100644 (file)
@@ -2897,6 +2897,7 @@ __ecereMethod___ecereNameSpace__ecere__sys__OldList_Add((&*parentExp->__anon1.li
 else if(parentExp && parentExp->type == 11)
 {
 parentExp->__anon1.cast.exp = newExp;
+if(newExp->expType && newExp->expType->classObjectType)
 parentExp->__anon1.cast.typeName->declarator = MkDeclaratorPointer(MkPointer((((void *)0)), (((void *)0))), parentExp->__anon1.cast.typeName->declarator);
 }
 if(typedObject && !memberExp->__anon1.member.exp->expType->classObjectType)
index 3054f37..e62404c 100644 (file)
@@ -1955,7 +1955,8 @@ static void ProcessExpression(Expression exp)
                            {
                               parentExp.cast.exp = newExp;
                               // Add a dereference level here
-                              parentExp.cast.typeName.declarator = MkDeclaratorPointer(MkPointer(null, null), parentExp.cast.typeName.declarator);
+                              if(newExp.expType && newExp.expType.classObjectType)
+                                 parentExp.cast.typeName.declarator = MkDeclaratorPointer(MkPointer(null, null), parentExp.cast.typeName.declarator);
                            }
                            if(typedObject && !memberExp.member.exp.expType.classObjectType)
                            {