Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8008215

break in catch clause causes java.lang.VerifyError: Inconsistent stackmap

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • P4
    • 8
    • None
    • core-libs
    • None
    • b82
    • Verified

    Description

      The following code should compile and run:

      a: try {
         throw new Error();
      } catch (e) {
         break a;
      }

      but throws a VerifyError in Nashorn:

      Exception in thread "main" java.lang.VerifyError: Inconsistent stackmap frames at branch target 48
      Exception Details:
        Location:
          jdk/nashorn/internal/scripts/Script$t.runScript(Ljdk/nashorn/internal/runtime/ScriptFunction;Ljava/lang/Object;)Ljava/lang/Object; @67: goto
        Reason:
          Current frame's stack size doesn't match stackmap.
        Current Frame:
          bci: @67
          flags: { }
          locals: { 'jdk/nashorn/internal/runtime/ScriptFunction', 'java/lang/Object', 'jdk/nashorn/internal/runtime/ScriptObject', 'jdk/nashorn/internal/runtime/Undefined', 'java/lang/Throwable', 'java/lang/Object' }
          stack: { }
        Stackmap Frame:
          bci: @48
          flags: { }
          locals: { 'jdk/nashorn/internal/runtime/ScriptFunction', 'java/lang/Object', 'jdk/nashorn/internal/runtime/ScriptObject', 'jdk/nashorn/internal/runtime/Undefined' }
          stack: { 'java/lang/Throwable' }
        Bytecode:
          0000000: 2ab6 0018 4dbb 001a 5903 b800 1e2c b700
          0000010: 21b8 0027 4db2 002b 4ebb 002d 592c ba00
          0000020: 3900 00ba 003c 0000 123d 0506 b700 40bf
          0000030: 3a04 1904 59c1 002d 9900 09c0 002d b400
          0000040: 443a 05a7 ffed 00bf
        Exception Handler Table:
          bci [25, 48] => handler: 48
        Stackmap Table:
          full_frame(@48,{Object[#20],Object[#81],Object[#83],Object[#85]},{Object[#71]})
          full_frame(@65,{Object[#20],Object[#81],Object[#83],Object[#85],Object[#71]},{Object[#81]})
          full_frame(@70,{},{Object[#71]})

      at java.lang.Class.getDeclaredFields0(Native Method)
      at java.lang.Class.privateGetDeclaredFields(Class.java:2349)
      at java.lang.Class.getField0(Class.java:2656)
      at java.lang.Class.getField(Class.java:1535)
      at jdk.nashorn.internal.codegen.Compiler.install(Compiler.java:277)
      at jdk.nashorn.internal.runtime.Context.compile(Context.java:932)
      at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:897)
      at jdk.nashorn.internal.runtime.Context.compileScript(Context.java:533)
      at jdk.nashorn.tools.Shell.runScripts(Shell.java:288)
      at jdk.nashorn.tools.Shell.run(Shell.java:169)
      at jdk.nashorn.tools.Shell.main(Shell.java:138)
      at jdk.nashorn.tools.Shell.main(Shell.java:117)

      Attachments

        Activity

          People

            hannesw Hannes Wallnoefer
            hannesw Hannes Wallnoefer
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: