@@ -1189,7 +1189,15 @@ struct DFAAnalyzer
11891189 DFAScope* sideEffectScope = dfaCommon.getSideEffectScope();
11901190 DFAScopeVar* scv = sideEffectScope.getScopeVar(root.storageFor);
11911191
1192- if (argListItem.paramType is null || argListItem.paramType.isTypeMutable)
1192+ version (none )
1193+ {
1194+ printf(" walking root=%p, cell=%p\n " , root, lr.findConsequence(root.storageFor));
1195+ }
1196+
1197+ // Check to see if the object is the storage for a variable that we can model.
1198+ // If so we probably already handled it with seePointer, so if we were to do it again it would be a duplicate.
1199+ if (lr.findConsequence(root.storageFor) is null
1200+ && (argListItem.paramType is null || argListItem.paramType.isTypeMutable))
11931201 seeWrite(root.storageFor, scv.lr, loc, silenceWriteError);
11941202 }
11951203 });
@@ -1512,7 +1520,6 @@ struct DFAAnalyzer
15121520 DFALatticeRef lr, int alteredState, ref Loc loc,
15131521 DFALatticeRef indexLR = DFALatticeRef.init)
15141522 {
1515-
15161523 DFAVar* assignToCtx = assignTo.getContextVar;
15171524 DFAVar* lrCtx;
15181525 DFAConsequence* lrCctx = lr.getContext(lrCtx);
@@ -1521,6 +1528,11 @@ struct DFAAnalyzer
15211528 const unmodellable = lrCtx ! is null && ! lrCtx.isModellable;
15221529 DFALatticeRef ret;
15231530
1531+ version (none )
1532+ {
1533+ printf(" assigning to var=%p, construct=%d, isBlit=%d, alteredState=%d, noLR=%d, lrIsTruthy=%d, unmodellable=%d\n " , assignToCtx, construct, isBlit, alteredState, noLR, lrIsTruthy, unmodellable);
1534+ }
1535+
15241536 this .onRead(assignTo, loc, true );
15251537 // Explicitly allow returns of uninitialized variables.
15261538 this .onRead(lr, loc, assignToCtx ! is null && assignToCtx is dfaCommon.getReturnVariable);
@@ -2573,6 +2585,7 @@ struct DFAAnalyzer
25732585 printf(" found storage %p, hadAnIndirection=%d, hadAnOuterDeref=%d, takenAddressOf=%d, hadFields=%d, isOffsetOfStorage=%d, unknown=%d\n " ,
25742586 var, hadAnIndirection, hadAnOuterDeref, takenAddressOf,
25752587 hadFields, isOffsetOfStorage, unknown);
2588+ printf(" isByRef=%d\n " , var.isByRef);
25762589 }
25772590
25782591 // Storage consequence may not have a object available for it.
@@ -3190,6 +3203,13 @@ private:
31903203 {
31913204 assignTo.visitIndirectSources((DFAVar* var, bool hadAnIndirection, bool hadAnInnerDeref, bool hadAnOuterDeref,
31923205 bool takenAddressOf, bool hadFields, bool isOffsetOfStorage, ref bool unknown) {
3206+ version (none )
3207+ {
3208+ printf(" Indirect source for %p, hadAnIndirection=%d, hadAnInnerDeref=%d, hadAnOuterDeref=%d, takenAddressOf=%d, hadFields=%d, isOffsetOfStorage=%d\n " ,
3209+ var, hadAnIndirection, hadAnInnerDeref, hadAnOuterDeref,
3210+ takenAddressOf, hadFields, isOffsetOfStorage);
3211+ }
3212+
31933213 if (hadAnIndirection || hadAnInnerDeref)
31943214 return ;
31953215
0 commit comments