<div dir="ltr"><div>Actually, it appears what the JVMS allows changed (i.e., got stricter) in classfile version 47.</div><div><br></div><div><a href="https://github.com/openjdk/jdk/blob/f64ed09e9a674a38f03f1e27e56fb19d72939ba1/src/hotspot/share/utilities/utf8.cpp#L332-L392">Here's the relevant hotspot code.</a></div><div><br></div><div>So the compiler should probably mirror that logic.</div><div><br></div><div>-Archie<br></div></div><br><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Mon, Mar 6, 2023 at 4:07 PM Archie Cobbs <<a href="mailto:archie.cobbs@gmail.com">archie.cobbs@gmail.com</a>> wrote:<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 dir="ltr">On Mon, Mar 6, 2023 at 4:01 PM Jonathan Gibbons <<a href="mailto:jonathan.gibbons@oracle.com" target="_blank">jonathan.gibbons@oracle.com</a>> wrote:</div><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">

  
  <div>
    <p>More on changing PoolReader ... ideally, this should be tied back
      to details in JVMS, and/or the spec updated to define the expected
      behavior of the VM and javac for similar but different equivalent
      names.</p></div></blockquote><div>Funny you should mention it :) See the PR I just filed (<a href="https://github.com/openjdk/jdk/pull/12893" target="_blank">link</a>), quoting:</div><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><p dir="auto">JVMS ยง4.4.7 describes "Modified UTF-8" for encoded 
strings, and it does not allow for non-standard encodings. Instead, 
you'll get something like this:</p><div><pre><code>$ java Test
Error: LinkageError occurred while loading main class Test
        java.lang.ClassFormatError: Illegal UTF8 string in constant pool in class file Test
</code></pre></div><p dir="auto">So the compiler should also reject any invalid classfiles containing them.</p></blockquote>

<p>-Archie<br></p></div></div>-- <br><div dir="ltr">Archie L. Cobbs<br></div></div>
</blockquote></div><br clear="all"><br>-- <br><div dir="ltr" class="gmail_signature">Archie L. Cobbs<br></div>