java.lang.verify错误:堆栈高度不一致1!= 2

问题描述

我有一个自定义应用程序,其中生成了Java指令代码。我们正在使用 javacc 生成代码。在其中一种情况下,我们遇到 java.lang.verify错误:堆栈高度不一致1 = 2

我检查了生成的类文件,并尝试对指令集进行解码,但是不明白为什么我会收到此错误。 类:测试,方法:runFunc签名:()Ljava / lang / Object;)堆栈高度不一致1 = 2 =

详细说明为

* java.lang.VerifyError:(类:测试,方法:runFunc签名:()Ljava / lang / Object;)堆栈高度不一致1!= 2

at java.lang.Class.getDeclaredConstructors0(Native Method)
    at java.lang.Class.privateGetDeclaredConstructors(Class.java:2671)
    at java.lang.Class.getConstructor0(Class.java:3075)
    at java.lang.Class.getDeclaredConstructor(Class.java:2178)

我检查了生成的类代码,并且runFunc函数如下所示:

protected final Object runFunc() {
        out = ((myPage) this).pageContext.getOut();
        parent = ((myPage) this).parent;
        ((myPage) this).pageContext.setPageEncoding("test");

        this.__tempIntertnalARRYSTRUCTVAR0.set(currentPage.StructNew());
        __myapp_internal_sdref_ = Cast._Map(_autoscalarize(this.__tempIntertnalARRYSTRUCTVAR0));
        __myapp_internal_sdref___restkeys = new ArrayList(4);
        _setDref_Struct(null,__myapp_internal_sdref_,"a",false);
        _set("rest",myPage._dreference_map_rest(__myapp_internal_sdref_,__myapp_internal_sdref___restkeys));

        outVar = (printOutput) _initFunction(class$myApplication$ext$io$printOutput,parent);
        _setCurrentLineNo(41);
        outVar.hasEndAttribute(true);

        try {
            if ((mode0 = outVar.doStart()) != 0)
                do {

                } while (outVar.doAfterBody() != 0);
            if (outVar.doEnd() == 5) {
                t8 = null;
                outVar.doFinally();
                return t8;
            }
            outVar.doFinally();
        } catch (Throwable throwable) {
            outVar.doCatch(throwable);
            outVar.doFinally();
        } catch (Throwable throwable) {
            outVar.doFinally();
            throw throwable;
        }
        _whitespace((Writer) out,"\r\n\r\n\r\n\r\n");
        return null;
    }

为使用javap实用程序获得的相同功能生成的指令代码如下:

protected final java.lang.Object runFunc();
    Code:
    0:aload_0
    1:getfield      #40                 // Field myApplication/runtime/myPage.pageContext:LmyApplication/runtime/AppPageContext;
    4:invokevirtual #46                 // Method javax/servlet/jsp/JspContext.getOut:()Ljavax/servlet/jsp/JspWriter;
    7:astore_1
    8:aload_0
    9:getfield      #50                 // Field myApplication/runtime/myPage.parent:Ljavax/servlet/jsp/ext/Operation;
    12:astore_3
    13:aload_0
    14:getfield      #40                 // Field myApplication/runtime/myPage.pageContext:LmyApplication/runtime/AppPageContext;
    17:ldc           #52                 // String test
    19:invokevirtual #58                 // Method myApplication/runtime/AppPageContext.setPageEncoding:(Ljava/lang/String;)V
    22:aload_0
    23:getfield      #33                 // Field __tempIntertnalARRYSTRUCTVAR0:LmyApplication/runtime/Variable;
    26:invokestatic  #62                 // Method myApplication/runtime/currentPage.StructNew:()Ljava/util/Map;
    29:invokevirtual #68                 // Method myApplication/runtime/Variable.set:(Ljava/lang/Object;)V
    32:aload_0
    33:aload_0
    34:getfield      #33                 // Field __tempIntertnalARRYSTRUCTVAR0:LmyApplication/runtime/Variable;
    37:invokevirtual #72                 // Method myApplication/runtime/myPage._autoscalarize:(myApplication/runtime/Variable;)Ljava/lang/Object;
    40:invokestatic  #78                 // Method myApplication/runtime/Cast._Map:(Ljava/lang/Object;)Ljava/util/Map;
    43:astore 4
    45:new           #80                 // class java/util/ArrayList
    48:dup
    49:iconst_4
    50:invokespecial #83                 // Method java/util/ArrayList."<init>":(I)V
    53:astore 5
    55:aload_0
    56:aconst_null
    57:aload 4
    59:ldc           #85                 // String a
    61:iconst_0
    62:invokevirtual #89                 // Method myApplication/runtime/myPage._setDref_Struct:(Ljava/lang/String;Ljava/util/Map;Ljava/lang/Object;Z)V
    65:aload 5
    67:ldc           #85                 // String a
    69:invokeinterface #95,2           // InterfaceMethod java/util/List.add:(Ljava/lang/Object;)Z
    74:aload_0
    75:ldc           #97                 // String rest
    77:aload 4
    79:aload 5
    81:invokestatic  #101                // Method myApplication/runtime/myPage._dreference_map_rest:(Ljava/util/Map;Ljava/util/List;)Ljava/util/Map;
    84:invokevirtual #105                // Method myApplication/runtime/myPage._set:(Ljava/lang/String;Ljava/lang/Object;)V
    87:aload_0
    88:getstatic     #117                // Field class$myApplication$ext$io$printOutput:Ljava/lang/Class;
    91:iconst_0
    92:aload_3
    93:invokevirtual #121                // Method myApplication/runtime/myPage._initFunction:(Ljava/lang/Class;ILjavax/servlet/jsp/ext/Operation;)Ljavax/servlet/jsp/ext/Operation;
    96:checkcast     #123                // class myApplication/ext/io/printOutput
    99:astore 6
    101:aload_0
    102:bipush 41
    104:invokevirtual #126                // Method myApplication/runtime/myPage._setCurrentLineNo:(I)V
    107:aload 6
    109:iconst_1
    110:invokevirtual #132                // Method myApplication/ext/GenericOperation.hasEndAttribute:(Z)V
    113:aload 6
    115:invokevirtual #136                // Method myApplication/ext/io/printOutput.doStart:()I
    118:dup
    119:istore 7
    121:ifeq 132
    124:aload 6
    126:invokevirtual #139                // Method myApplication/ext/io/printOutput.doAfterBody:()I
    129:ifne 124
    132:aload 6
    134:invokevirtual #144                // Method myApplication/ext/QueryLoop.doEnd:()I
    137:iconst_5
    138:if_icmpne 150
    141:aconst_null
    142:astore 8
    144:jsr 179
    147:aload 8
    149:areturn
    150:jsr 179
    153:goto 188
    156:astore 9
    158:aload 6
    160:aload 9
    162:invokevirtual #148                // Method myApplication/ext/QueryLoop.doCatch:(Ljava/lang/Throwable;)V
    165:jsr 179
    168:goto 188
    171:astore 10
    173:jsr 179
    176:aload 10
    178:athrow
    179:astore 11
    181:aload 6
    183:invokevirtual #151                // Method myApplication/ext/io/printOutput.doFinally:()V
    186:ret 11
    188:aload_0
    189:aload_1
    190:ldc           #153                // String \r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n\r\n
    192:invokevirtual #157                // Method myApplication/runtime/myPage._whitespace:(Ljava/io/Writer;Ljava/lang/String;)V
    195:aconst_null
    196:areturn

如果有人能指出堆栈不平衡发生在哪里,我将非常感激。 期待积极的回应, 预先感谢。

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

错误1:Request method ‘DELETE‘ not supported 错误还原:...
错误1:启动docker镜像时报错:Error response from daemon:...
错误1:private field ‘xxx‘ is never assigned 按Alt...
报错如下,通过源不能下载,最后警告pip需升级版本 Requirem...