compiler/libec/pass16: Fixed losing prev/next pointer manipulating expression
authorJerome St-Louis <jerome@ecere.com>
Wed, 4 Jun 2014 03:23:37 +0000 (23:23 -0400)
committerJerome St-Louis <jerome@ecere.com>
Wed, 4 Jun 2014 03:23:37 +0000 (23:23 -0400)
- Index() was losing an argument:
   class MyClass : struct { }
   MapIterator<MyClass, int> it { };
   it.Index({ }, false);

compiler/bootstrap/libec/bootstrap/pass16.c
compiler/libec/src/pass16.ec

index 3ce9fbc..9bccae8 100644 (file)
@@ -2291,11 +2291,15 @@ PopContext(exp->__anon1.compound->__anon1.compound.context);
 }
 else
 {
+struct Expression * prev = exp->prev, * next = exp->next;
+
 FreeType(newCall->destType);
 FreeType(newCall->expType);
 newCall->destType = exp->destType;
 newCall->expType = exp->expType;
 *exp = *newCall;
+exp->prev = prev;
+exp->next = next;
 ((newCall ? (__ecereClass_Expression->Destructor ? __ecereClass_Expression->Destructor((void *)newCall) : 0, __ecereNameSpace__ecere__com__eSystem_Delete(newCall)) : 0), newCall = 0);
 }
 }
index 6e4b928..31b4c0d 100644 (file)
@@ -1149,11 +1149,14 @@ static void ProcessExpression(Expression exp)
                   }
                   else
                   {
+                     Expression prev = exp.prev, next = exp.next;
                      FreeType(newCall.destType);
                      FreeType(newCall.expType);
                      newCall.destType = exp.destType;
                      newCall.expType = exp.expType;
                      *exp = *newCall;
+                     exp.prev = prev;
+                     exp.next = next;
                      delete newCall;
                   }
                }