<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Mon, Jun 29, 2015 at 10:57 AM, Dmitry Vyukov <span dir="ltr"><<a href="mailto:dvyukov@google.com" target="_blank">dvyukov@google.com</a>></span> wrote:<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">But it is possible that the next landingpad up the stack is within the same function. In such case I don't need to execute __tsan_func_exit. That's what I tried to show with the examples.</blockquote><div><br></div><div>The 'resume' instruction always leaves the current function and unwinds the stack. Intra-frame EH actions are handled by normal control flow, which is what the icmp+br instructions are doing. This is pseudo-code for what the landingpad is doing:</div><div><br></div><div>lpad:</div><div>  // EAX:EDX are live-in to the landingpad, think of it as the exceptional return value<br></div><div>  (ehptr, ehselector) = (EAX, EDX);</div><div>  if (ehselector == kTypeIDInt) goto <a href="https://urldefense.proofpoint.com/v2/url?u=http-3A__catch.int&d=AwMFaQ&c=8hUWFZcy2Z-Za5rBPlktOQ&r=mQ4LZ2PUj9hpadE3cDHZnIdEwhEBrbAstXeMaFoB9tg&m=7fBqRq7lHshK8oM-lv9olDwjATV9HI1ZpiWejrIqzDw&s=9kHzZl7J1LSPe6S3ioG2eqgcciep_tUr6yq9Lb_GGVo&e=">catch.int</a>;</div><div>  if (ehselector == kTypeIDDouble) goto catch.double;<br></div><div>  resume;</div></div></div></div>