<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=Windows-1252">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Hi Mark,</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
This indeed is weird - the ClassFile API's generation should force another branching check at bci 6 against the handler at 36 for frame compatibility, and should fail there. Unfortunately, I am busy with other projects right now and cannot divest a lot of time
 investigating this; can you try creating a minimal reproduction, like a simple method that has a try-catch and a post action, and a very simple transform, both of which don't require extra library dependencies?</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div class="elementToProof" style="font-family: Aptos, Aptos_EmbeddedFont, Aptos_MSFontService, Calibri, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
Regards, Chen</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Mark Roberts <markro@cs.washington.edu><br>
<b>Sent:</b> Tuesday, January 28, 2025 2:45 PM<br>
<b>To:</b> classfile-api-dev@openjdk.org <classfile-api-dev@openjdk.org><br>
<b>Cc:</b> Chen Liang <chen.l.liang@oracle.com><br>
<b>Subject:</b> [External] : StackMap problem</font>
<div> </div>
</div>
<style>
<!--
@font-face
        {font-family:"Cambria Math"}
@font-face
        {font-family:Calibri}
p.x_MsoNormal, li.x_MsoNormal, div.x_MsoNormal
        {margin:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif}
a:link, span.x_MsoHyperlink
        {color:blue;
        text-decoration:underline}
span.x_EmailStyle25
        {font-family:"Calibri",sans-serif;
        color:windowtext}
.x_MsoChpDefault
        {font-size:10.0pt}
@page WordSection1
        {margin:1.0in 1.0in 1.0in 1.0in}
div.x_WordSection1
        {}
-->
</style>
<div lang="EN-US" link="blue" vlink="purple" style="word-wrap:break-word">
<div class="x_WordSection1">
<p class="x_MsoNormal">The existence of compiler generated, unnamed local temps (no LocalVariable code element) seems to cause a problem with stack maps.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">The ‘source’ attachment shows the problem method.   The ‘before’ attachment shows the generated code before instrumentation.  Note that the compiler generates an unnamed temp at slot 0 to store the exception code. The stackmap for the
 branch target says same locals, which is correct.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">The ‘after’ attachment shows the code generated after our tool has added instrumentation code – note the addition of a new local variable at slot 1.  The stackmap for the branch target still says same locals, which is no longer correct.
 This causes the iload_1 @41 to fail.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">I tried to see if this issue has already been reported, but I was unable to figure out how to search
<a href="https://urldefense.com/v3/__https://bugs.java.com/bugdatabase/__;!!ACWV5N9M2RV99hQ!J8Z_mD-T0Ps_kClOITgamtTMlXOdh7853QyTHD_sdbzUyIjKujz-4jcUs9Y0Y7iKjgO6vAwjbQvGbgT91qY0mw519Q$">
https://bugs.java.com/bugdatabase/</a> by keyword.</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal">Mark</p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
<p class="x_MsoNormal"> </p>
</div>
</div>
</body>
</html>