<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=utf-8">
<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;}
@font-face
        {font-family:Aptos;
        panose-1:2 11 0 4 2 2 2 2 2 4;}
@font-face
        {font-family:Consolas;
        panose-1:2 11 6 9 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        font-size:12.0pt;
        font-family:"Aptos",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
pre
        {mso-style-priority:99;
        mso-style-link:"HTML Preformatted Char";
        margin:0in;
        margin-bottom:.0001pt;
        font-size:10.0pt;
        font-family:"Courier New";}
span.HTMLPreformattedChar
        {mso-style-name:"HTML Preformatted Char";
        mso-style-priority:99;
        mso-style-link:"HTML Preformatted";
        font-family:Consolas;}
span.EmailStyle20
        {mso-style-type:personal;
        font-family:"Aptos",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-size:10.0pt;
        mso-ligatures:none;}
@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" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="WordSection1">
<p class="MsoNormal"><span style="font-family:"Calibri",sans-serif"></span><o:p></o:p></p>
<p class="MsoNormal"><span class="EmailStyle20"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif"></span></span><span class="EmailStyle20"><span style="font-size:11.0pt"><o:p></o:p></span></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">You are right, it is a recent regression and the JDK I tested it on was outdated, my apologies.</span><o:p></o:p></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">The regression is here:<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><a href="https://github.com/openjdk/jdk/blob/f77a5144a12fc31bad8b672a3cc9caa688d78e72/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java#L1117">https://github.com/openjdk/jdk/blob/f77a5144a12fc31bad8b672a3cc9caa688d78e72/src/java.base/share/classes/jdk/internal/classfile/impl/StackMapGenerator.java#L1117</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">introduced by <a href="https://github.com/openjdk/jdk/pull/20756">
https://github.com/openjdk/jdk/pull/20756</a><o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">I’ve created a bug <a href="https://bugs.openjdk.org/browse/JDK-8343436">
https://bugs.openjdk.org/browse/JDK-8343436</a> and working on the fix.<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Thanks for the report,<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt">Adam<o:p></o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<p class="MsoNormal"><span style="font-size:11.0pt"><o:p> </o:p></span></p>
<div id="mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid #B5C4DF 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal" style="margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">Rafael Winterhalter <rafael.wth@gmail.com><br>
<b>Date: </b>Wednesday, 30 October 2024 at 11:41<br>
<b>To: </b>Adam Sotona <adam.sotona@oracle.com><br>
<b>Cc: </b>classfile-api-dev <classfile-api-dev@openjdk.org><br>
<b>Subject: </b>[External] : Re: Stack size miscalculated with try-catch blocks<o:p></o:p></span></p>
</div>
<div>
<p class="MsoNormal">Is this pushed to master? I still experience these errors on multiple test cases.</p>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">Am Mi., 30. Okt. 2024 um 10:19 Uhr schrieb Adam Sotona <<a href="mailto:adam.sotona@oracle.com">adam.sotona@oracle.com</a>>:</p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
<div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Hi Rafael,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Please update to the latest codebase, maxstack of the provided test case is correctly calculated now.</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Thanks,</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt">Adam</span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"><span style="font-size:11.0pt"> </span><o:p></o:p></p>
<div id="m_-4229465549680019841mail-editor-reference-message-container">
<div>
<div>
<div style="border:none;border-top:solid windowtext 1.0pt;padding:3.0pt 0in 0in 0in;border-color:currentcolor currentcolor">
<p class="MsoNormal" style="mso-margin-top-alt:auto;margin-bottom:12.0pt"><b><span style="color:black">From:
</span></b><span style="color:black">classfile-api-dev <</span><a href="mailto:classfile-api-dev-retn@openjdk.org" target="_blank">classfile-api-dev-retn@openjdk.org</a><span style="color:black">> on behalf of Rafael Winterhalter <</span><a href="mailto:rafael.wth@gmail.com" target="_blank">rafael.wth@gmail.com</a><span style="color:black">><br>
<b>Date: </b>Thursday, 24 October 2024 at 8:33<br>
<b>To: </b>classfile-api-dev <</span><a href="mailto:classfile-api-dev@openjdk.org" target="_blank">classfile-api-dev@openjdk.org</a><span style="color:black">><br>
<b>Subject: </b>Stack size miscalculated with try-catch blocks</span><o:p></o:p></p>
</div>
<div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Hello,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">when testing a recent build of the JDK with my bridge to ASM, I encountered some test failures. This is related to the stack size of a method being calculated with an additional,
 unnecessary slot. This can be reproduced using <a href="https://urldefense.com/v3/__https:/github.com/raphw/asm-jdk-bridge__;!!ACWV5N9M2RV99hQ!Jc9CG0Gsp57pUC2shOI0ROdVXcjc33MSPr_6s-ugdwRI-ninSwYcWmlXc3TwkuBlJeZIGgwHvHBoYue6PZBm$" target="_blank">
https://github.com/raphw/asm-jdk-bridge</a><o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">This can also be reproduced by inspecting the computed stack for:<o:p></o:p></p>
</div>
<div>
<div>
<pre style="background:#1E1F22"><span style="color:#CF8E6D">void </span><span style="color:#56A8F5">c</span><span style="color:#BCBEC4">() {<br>    </span><span style="color:#CF8E6D">try </span><span style="color:#BCBEC4">{<br>        </span><span style="color:#CF8E6D">throw new </span><span style="color:#BCBEC4">RuntimeException();<br>    } </span><span style="color:#CF8E6D">catch </span><span style="color:#BCBEC4">(RuntimeException e) {<br>    }<br>}</span></pre>
</div>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">which will be computed as 3 and not 2.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto"> <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal" style="mso-margin-top-alt:auto;mso-margin-bottom-alt:auto">Best regards, Rafael<o:p></o:p></p>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</blockquote>
</div>
</div>
</div>
</div>
</div>
</body>
</html>