<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;"><br><div><div>On Apr 10, 2013, at 14:42 , Anna Zaks <<a href="mailto:ganna@apple.com">ganna@apple.com</a>> wrote:</div><div><br></div><div><blockquote type="cite"><span style="font-family: Menlo-Regular; font-size: 11px;">+struct AllocationInfo {</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;">+  const ExplodedNode* N;</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;">+  const MemRegion* R;</span><br style="font-family: Menlo-Regular; font-size: 11px;"></blockquote><br></div><div>Style: asterisks with the field names.</div><div><br></div><br class="Apple-interchange-newline"><blockquote type="cite"><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+      if (const ObjCMessageExpr *ME = dyn_cast<ObjCMessageExpr>(CE)) {</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+        SVal RecVal = St->getSVal(ME->getInstanceReceiver(), NContext);</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+        if (RecVal.getAsSymbol() == Sym && ME->getMethodFamily() == OMF_init)</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+          InitMethodContext = CEP->getCalleeContext();</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"><span style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px; float: none; display: inline !important;">+      }</span><br style="font-family: Menlo-Regular; font-size: 11px; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: auto; text-align: start; text-indent: 0px; text-transform: none; white-space: normal; widows: auto; word-spacing: 0px; -webkit-text-stroke-width: 0px;"></blockquote></div><br><div>What happens when getSVal gets a null Expr? Seems like a bad idea, and also doesn't work if there are nested inlineable [super init] calls (super is not an instance receiver).</div><div><br></div><div>Well, actually, this won't work for nested [super init] calls anyway. Maybe we want to mark the last init call as interesting rather than the first one? That actually makes more sense for delegating initializers as well.</div><div><br></div><div>The check for OMF_init is probably cheaper as well. You could check that first, then use CallEventManager::getObjCMethodCall to get the receiver safely via CallEvent.</div><div><br></div><div><br></div><div><blockquote type="cite"><span style="font-family: Menlo-Regular; font-size: 11px;">+  // If we are reporting a leak of the object that was allocated with alloc,</span><br style="font-family: Menlo-Regular; font-size: 11px;"><span style="font-family: Menlo-Regular; font-size: 11px;">+  // mark it's init method as interesting.</span><br style="font-family: Menlo-Regular; font-size: 11px;"></blockquote><br></div><div>Typo: "its"</div></body></html>