<div dir="ltr">So generally, all tempAt: accesses should be protected?<br></div><div class="gmail_extra"><br><div class="gmail_quote">2014-09-29 23:22 GMT+02:00  <span dir="ltr">&lt;<a href="mailto:commits@source.squeak.org" target="_blank">commits@source.squeak.org</a>&gt;</span>:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Eliot Miranda uploaded a new version of Kernel to project The Trunk:<br>
<a href="http://source.squeak.org/trunk/Kernel-eem.876.mcz" target="_blank">http://source.squeak.org/trunk/Kernel-eem.876.mcz</a><br>
<br>
==================== Summary ====================<br>
<br>
Name: Kernel-eem.876<br>
Author: eem<br>
Time: 29 September 2014, 2:21:45.514 pm<br>
UUID: 9ea5bea7-14c9-48c9-9d49-ca311d68d49a<br>
Ancestors: Kernel-ul.875<br>
<br>
Fix handleSignal: for a rare edge case that can<br>
occur on Stack &amp; Cog VMs.<br>
<br>
=============== Diff against Kernel-ul.875 ===============<br>
<br>
Item was changed:<br>
  ----- Method: ContextPart&gt;&gt;handleSignal: (in category &#39;private-exceptions&#39;) -----<br>
  handleSignal: exception<br>
+       &quot;Sent to handler (on:do:) contexts only.  If my exception class (first arg) handles exception<br>
+        and the handler is active then execute my handle block (second arg), otherwise forward<br>
+        this message to the next handler context.  If none left, execute exception&#39;s defaultAction<br>
+        (see nil&gt;&gt;handleSignal:).&quot;<br>
-       &quot;Sent to handler (on:do:) contexts only.  If my exception class (first arg) handles exception then execute my handle block (second arg), otherwise forward this message to the next handler context.  If none left, execute exception&#39;s defaultAction (see nil&gt;&gt;handleSignal:).&quot;<br>
<br>
+       | handlerActive val |<br>
+       &quot;If the context has been returned from the handlerActive temp var may not be accessible.&quot;<br>
+       handlerActive := stackp &gt;= 3 and: [(self tempAt: 3) == true].<br>
+       (((self tempAt: 1) handles: exception) and: [handlerActive]) ifFalse:<br>
+               [^self nextHandlerContext handleSignal: exception].<br>
-       | val |<br>
-       (((self tempAt: 1) handles: exception) and: [self tempAt: 3]) ifFalse: [<br>
-               ^ self nextHandlerContext handleSignal: exception].<br>
<br>
        exception privHandlerContext: self contextTag.<br>
        self tempAt: 3 put: false.  &quot;disable self while executing handle block&quot;<br>
+       val := [(self tempAt: 2) cull: exception]<br>
+                       ensure: [self tempAt: 3 put: true].<br>
+       self return: val  &quot;return from self if not otherwise directed in handle block&quot;<br>
-       val := [(self tempAt: 2) cull: exception ]<br>
-               ensure: [self tempAt: 3 put: true].<br>
-       self return: val.  &quot;return from self if not otherwise directed in handle block&quot;<br>
  !<br>
<br>
<br>
</blockquote></div><br></div>