http://d.puremagic.com/issues/show_bug.cgi?id=5117


Don <clugd...@yahoo.com.au> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |patch
                 CC|                            |clugd...@yahoo.com.au
           Severity|normal                      |critical


--- Comment #2 from Don <clugd...@yahoo.com.au> 2010-10-29 01:49:57 PDT ---
PATCH:
interpret.c, line 224, FuncDeclaration::interpret().

    // Don't restore the value of 'this' upon function return
-    if (needThis() && thisarg->op == TOKvar && istate)
+    if (needThis() && istate)
    {
-        VarDeclaration *thisvar = ((VarExp
*)(thisarg))->var->isVarDeclaration();
+        VarDeclaration *thisvar = findParentVar(thisarg, istate->localThis);   
        for (size_t i = 0; i < istate->vars.dim; i++)
        {   VarDeclaration *v = (VarDeclaration *)istate->vars.data[i];
            if (v == thisvar)
            {   istate->vars.data[i] = NULL;
                break;
            }

and also add
VarDeclaration * findParentVar(Expression *e, Expression *thisval);
to the top of the file.

This fixes both test cases.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------

Reply via email to