Changeset 709

Show
Ignore:
Timestamp:
10/08/10 16:36:54 (4 years ago)
Author:
walter
Message:

bugzilla 2943 Struct copying in presence of alias member this only copies alias this member

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/src/opover.c

    r630 r709  
    683683#if DMDV2 
    684684    // Try alias this on first operand 
    685     if (ad1 && ad1->aliasthis) 
     685    if (ad1 && ad1->aliasthis && 
     686        !(op == TOKassign && ad2 && ad1 == ad2))   // See Bugzilla 2943 
    686687    { 
    687688        /* Rewrite (e1 op e2) as: 
     
    696697 
    697698    // Try alias this on second operand 
    698     if (ad2 && ad2->aliasthis) 
     699    if (ad2 && ad2->aliasthis && 
     700        /* Bugzilla 2943: make sure that when we're copying the struct, we don't 
     701         * just copy the alias this member 
     702         */ 
     703        !(op == TOKassign && ad1 && ad1 == ad2)) 
    699704    { 
    700705        /* Rewrite (e1 op e2) as: