Bad type array size

Issue #238 resolved
Jesper Öqvist created an issue

ExtendJ 8.0.1-234-g7a7bcbc Java SE 8

ExtendJ generates broken stack map frames for this test:

public class Test {
  static boolean compare(long x) {
    long l = 733903704455L;
    return (l != x);

  public static void main(String[] args) {

Expected result: should print "true".

Actual result: runtime error:

    [junit] [FAIL] runTest[run/cmp_ne_01](tests.extendj.TestJava7)
    [junit] Error output files differ expected:<[]> but was:<[Error: A JNI error has occurred, please check your installation and try again
    [junit] Exception in thread "main" java.lang.ClassFormatError: StackMapTable format error: bad type array size in method
    [junit]     at java.lang.Class.getDeclaredMethods0(Native Method)
    [junit]     at java.lang.Class.privateGetDeclaredMethods(
    [junit]     at java.lang.Class.privateGetMethodRecursive(
    [junit]     at java.lang.Class.getMethod0(
    [junit]     at java.lang.Class.getMethod(
    [junit]     at sun.launcher.LauncherHelper.validateMainClass(
    [junit]     at sun.launcher.LauncherHelper.checkAndLoadMain(]>

Comments (1)

  1. Jesper Öqvist reporter

    Fix stack map frame generation issue

    An incorrect number of assigned local slots was computed when creating a diff stack frame. This lead to an incorrect number of append_frame entries.

    Also fixed an error in how local variable space was allocated. For wide types, the second entry was sometimes not set to TOP. Wide types should instead always be followed by TOP in the local variable map.

    fixes #238 (bitbucket)

    → <<cset 49efefa08afd>>

  2. Log in to comment