<html xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
.MsoChpDefault
        {mso-style-type:export-only;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style>
</head>
<body lang="EN-US" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal">Hi,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">I’d like to report a bug in how Cuis handles nested #outer exceptions. Try the following example:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">path := ''.</p>
<p class="MsoNormal">[path := path, '1'.</p>
<p class="MsoNormal">              [path := path, '2'.</p>
<p class="MsoNormal">                           [1/0] on: ZeroDivide do: [:ex | ex outer. path := path, '5'. ex return].
</p>
<p class="MsoNormal">                           path := path, '6'</p>
<p class="MsoNormal">              ] on: ZeroDivide do: [:ex | ex outer. path := path, '4'. ex resume].</p>
<p class="MsoNormal">              path := path, '7'</p>
<p class="MsoNormal">] on: ZeroDivide do: [:ex | path := path, '3'. ex resume].</p>
<p class="MsoNormal">path  </p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Currently it answers '12345' which means points 6 and 7 have been missed. The reason is incorrect handling of saved handlerContexts. I tried to fix the current Cuis implementation using a collection handlerContexts but I’m not sure it’s
 possible. I can’t even figure out what was the handlerContexts collection intended for (please let me know if I’ve missed it). Current handler contexts can be easily tracked by using a temporary variable in #outer and retrieved back in #resumeUnchecked – see
 the enclosed changeset illustrating the idea. In case the handlerContexts collection has no other (real or intended) use then it could be replaced by a simple handlerContext variable containing the handler of the exception being currently dealt with and the
 two ugly lines would be replaced by:</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">+            handlerContext _ ctxt tempAt: 2. "currHandlerContext in #outer"<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">-            self popHandlerContext. "update the top context with the #outer handler"</p>
<p class="MsoNormal">-            self pushHandlerContext: (ctxt tempAt: 2). "currHandlerContext in #outer"</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Best regards,</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal">Jaromir</p>
<p class="MsoNormal"><o:p> </o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</body>
</html>