<!DOCTYPE html><html><head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
</head>
<body>
<p>Hello Rafael,</p>
<p><br>
</p>
<p>I peeked at this, and it seems to me that when javac writes the
file, the table switch offsets seem sensible:</p>
<p> 100: 322<br>
101: 374<br>
102: 374<br>
103: 374<br>
104: 374<br>
105: 374<br>
106: 374<br>
107: 374<br>
108: 374<br>
109: 296<br>
110: 374<br>
111: 374<br>
112: 361<br>
113: 374<br>
114: 335<br>
115: 348<br>
116: 309<br>
default: 374</p>
<p>(I tweaked javac to make a copy of the generated classfile right
after it is done with writing it to the disk.)<br>
</p>
<p>But when the build ends, the classfile does not look sensible
anymore. Is there some classfile postprocessing going on? Could
you please check if that's working correctly?</p>
<p><br>
</p>
<p>Thanks,</p>
<p> Jan</p>
<p><br>
</p>
<div class="moz-cite-prefix">On 21. 03. 25 11:15, Rafael
Winterhalter wrote:<br>
</div>
<blockquote type="cite" cite="mid:CA+DM0A=DRWWcwnMa9oOTSi+U2F5u-dDFpVC+UKmrz_sz=M0AKQ@mail.gmail.com">
<div dir="ltr">(And of course, this is the right list, I
originally thought to post this to the HotSpot list, but this
happens in interpreted mode, so I excluded that.)</div>
<br>
<div class="gmail_quote gmail_quote_container">
<div dir="ltr" class="gmail_attr">Am Fr., 21. März 2025 um
11:14 Uhr schrieb Rafael Winterhalter <<a href="mailto:rafael.wth@gmail.com" moz-do-not-send="true" class="moz-txt-link-freetext">rafael.wth@gmail.com</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div dir="ltr">
<div>The error is stable and can be reproduced by simply
building the project. But it seems to be an issue with
javac indeed. The tableswitch statement is compiled as
follows.</div>
<div><br>
</div>
<div> 213: tableswitch { // 100 to 116<br>
100: 322<br>
101: 296<br>
102: 361<br>
103: 335<br>
104: 348<br>
105: 309<br>
106: 374<br>
107: 374<br>
108: 374<br>
109: 374<br>
110: 374<br>
111: 374<br>
112: 374<br>
113: 374<br>
114: 374<br>
115: 374<br>
116: 374<br>
default: 374</div>
<div><br>
</div>
<div>The right branch for 'p' is included at offset 361, but
'p' is an integer value of 109. The character 102 (f) is
not included in the Java source.</div>
<div><br>
</div>
<div>I guess this is the wrong mailing list in this case. I
will post this to the javac list.</div>
<div><br>
</div>
<div>Thanks, Rafael</div>
</div>
<br>
<div class="gmail_quote">
<div dir="ltr" class="gmail_attr">Am Fr., 21. März 2025 um
10:54 Uhr schrieb Remi Forax <<a href="mailto:forax@univ-mlv.fr" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">forax@univ-mlv.fr</a>>:<br>
</div>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
<div>
<div style="font-family:arial,helvetica,sans-serif;font-size:12pt;color:rgb(0,0,0)">
<div>Hello Raphael,</div>
<div>It may be hard to reproduce,</div>
<div>can you do a javap -c on the class/method so it
will be easier to see if the generated bytecode is
wrong of if it's a VM issue.</div>
<div><br>
</div>
<div>regards,</div>
<div>Rémi</div>
<div><br>
</div>
<hr id="m_6833689223670212611m_3686300147316054987m_649006921082298200zwchr">
<div>
<blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt"><b>From:
</b>"Rafael Winterhalter" <<a href="mailto:rafael.wth@gmail.com" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">rafael.wth@gmail.com</a>><br>
<b>To: </b>"compiler-dev" <<a href="mailto:compiler-dev@openjdk.org" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">compiler-dev@openjdk.org</a>><br>
<b>Sent: </b>Friday, March 21, 2025 10:20:48 AM<br>
<b>Subject: </b>Bug in JDK25 with switch
statements<br>
</blockquote>
</div>
<div>
<blockquote style="border-left:2px solid rgb(16,16,255);margin-left:5px;padding-left:5px;color:rgb(0,0,0);font-weight:normal;font-style:normal;text-decoration:none;font-family:Helvetica,Arial,sans-serif;font-size:12pt">
<div dir="ltr">
<div>Hello,</div>
<div>my project Byte Buddy fails to build with
recent JDK 25s. I am not sure if this is a
known bug, but I wanted to mention it: <a href="https://github.com/raphw/byte-buddy/actions/runs/13975513319/job/39131008617" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/raphw/byte-buddy/actions/runs/13975513319/job/39131008617</a><br>
</div>
<br>
<div>The reason for the build failure is that
this switch statement ends up in the default
branch: <a href="https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java#L3239" target="_blank" moz-do-not-send="true" class="moz-txt-link-freetext">https://github.com/raphw/byte-buddy/blob/master/byte-buddy-dep/src/main/java/net/bytebuddy/asm/Advice.java#L3239</a><br>
</div>
<br>
<div>This is happening for the char 'p' which is
the last legal branch of the switch. This does
not yield an error on JDKs 5 to 24, so this
must be introduced recently.</div>
<br>
<div>Thanks, Rafael</div>
</div>
<br>
</blockquote>
</div>
</div>
</div>
</blockquote>
</div>
</blockquote>
</div>
</blockquote>
</body>
</html>