<html><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Jan 12, 2009, at 5:13 PM, Zhongxing Xu wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><br class="Apple-interchange-newline">On Tue, Jan 13, 2009 at 7:23 AM, Ted Kremenek<span class="Apple-converted-space"> </span><span dir="ltr"><<a href="mailto:kremenek@apple.com">kremenek@apple.com</a>></span><span class="Apple-converted-space"> </span>wrote:<br><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; "><div>This looks great!  Two comments:<div><br></div><div><div class="Ih2E3d"><div>+const GRState* RegionStoreManager::KillStruct(const GRState* St,</div><div>+                                              const TypedRegion* R){</div><div>+  GRStateRef state(St, StateMgr);</div><div>+</div></div><div>+  // Kill the struct region because it is assigned "unknown".</div><div>+  St = state.add<RegionKills>(R);</div><div>+  </div><div>+  // Set the default value of the struct region to "unknown".</div><div class="Ih2E3d"><div>+  St = state.set<RegionDefaultValue>(R, UnknownVal());</div></div><div>+</div><div>+  // Remove the struct region from the RegionViews. It could only be a "view" of</div><div>+  // its super region.</div><div>+  St = RemoveRegionView(St, R, R->getSuperRegion());</div><div><br></div><div>Hmm.  I'm looking at this again, I guess removing the view of 'R' from its super region doesn't make sense.  It's just the values bound to 'R' that change, not the fact that 'R' is a view of its super region.</div></div></div></blockquote><div><br>Yes, that was my initial thought. :-)</div></span></blockquote><div><br></div>Indeed it was.  ;-)</div><div><br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><br> </div><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; "><div><div><div></div><div class="Ih2E3d"><div><br></div><div>+</div><div>+  Store store = St->getStore();</div><div>+  RegionBindingsTy B = GetRegionBindings(store);</div><div>+</div></div><div>+  // Remove all bindings for the subregions of the struct.</div><div>+  for (RegionBindingsTy::iterator I = B.begin(), E = B.end(); I != E; ++I) {</div><div class="Ih2E3d"><div>+    const MemRegion* r = I.getKey();</div><div>+    if (const SubRegion* sr = dyn_cast<SubRegion>(r))</div><div>+      if (sr->isSubRegionOf(R))</div></div><div>+        store = Remove(store, Loc::MakeVal(sr));</div><div><br></div><div>I am wondering if we also need to remove bindings for views of 'sr'.  That is, iterate over the views of 'sr' and remove any bindings from state.  What do you think?  I guess it depends on how we decide to bind values in weird cases where people abuse the type system.</div></div></div></blockquote><div><br>I am afraid the cost would be too high, and the logic be too complex for an initial implementation. After all we are doing an approximate simulation, not an exhaustive one. I suggest we leave a FIXME here and fix it when we see a real bug caused by this simplification.</div></span></blockquote><div><br></div>Makes sense.  Please take out the RemoveRegionView call (but go ahead and add the method itself) and commit the change.<br><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; color: rgb(0, 0, 0); font-family: Helvetica; font-size: 14px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0; "><div><br> </div><blockquote class="gmail_quote" style="border-left-width: 1px; border-left-style: solid; border-left-color: rgb(204, 204, 204); margin-top: 0pt; margin-right: 0pt; margin-bottom: 0pt; margin-left: 0.8ex; padding-left: 1ex; "><div><div><div></div><div><br></div><div>+  }</div><div class="Ih2E3d"><div>+</div><div>+  return StateMgr.MakeStateWithStore(St, store);</div></div><div>+}</div><div>+</div></div></div></blockquote></span></blockquote></div><br></body></html>