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

如何解决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 举报,一经查实,本站将立刻删除。

相关推荐


使用本地python环境可以成功执行 import pandas as pd import matplotlib.pyplot as plt # 设置字体 plt.rcParams[&#39;font.sans-serif&#39;] = [&#39;SimHei&#39;] # 能正确显示负号 p
错误1:Request method ‘DELETE‘ not supported 错误还原:controller层有一个接口,访问该接口时报错:Request method ‘DELETE‘ not supported 错误原因:没有接收到前端传入的参数,修改为如下 参考 错误2:cannot r
错误1:启动docker镜像时报错:Error response from daemon: driver failed programming external connectivity on endpoint quirky_allen 解决方法:重启docker -&gt; systemctl r
错误1:private field ‘xxx‘ is never assigned 按Altʾnter快捷键,选择第2项 参考:https://blog.csdn.net/shi_hong_fei_hei/article/details/88814070 错误2:启动时报错,不能找到主启动类 #
报错如下,通过源不能下载,最后警告pip需升级版本 Requirement already satisfied: pip in c:\users\ychen\appdata\local\programs\python\python310\lib\site-packages (22.0.4) Coll
错误1:maven打包报错 错误还原:使用maven打包项目时报错如下 [ERROR] Failed to execute goal org.apache.maven.plugins:maven-resources-plugin:3.2.0:resources (default-resources)
错误1:服务调用时报错 服务消费者模块assess通过openFeign调用服务提供者模块hires 如下为服务提供者模块hires的控制层接口 @RestController @RequestMapping(&quot;/hires&quot;) public class FeignControl
错误1:运行项目后报如下错误 解决方案 报错2:Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.8.1:compile (default-compile) on project sb 解决方案:在pom.
参考 错误原因 过滤器或拦截器在生效时,redisTemplate还没有注入 解决方案:在注入容器时就生效 @Component //项目运行时就注入Spring容器 public class RedisBean { @Resource private RedisTemplate&lt;String
使用vite构建项目报错 C:\Users\ychen\work&gt;npm init @vitejs/app @vitejs/create-app is deprecated, use npm init vite instead C:\Users\ychen\AppData\Local\npm-
参考1 参考2 解决方案 # 点击安装源 协议选择 http:// 路径填写 mirrors.aliyun.com/centos/8.3.2011/BaseOS/x86_64/os URL类型 软件库URL 其他路径 # 版本 7 mirrors.aliyun.com/centos/7/os/x86
报错1 [root@slave1 data_mocker]# kafka-console-consumer.sh --bootstrap-server slave1:9092 --topic topic_db [2023-12-19 18:31:12,770] WARN [Consumer clie
错误1 # 重写数据 hive (edu)&gt; insert overwrite table dwd_trade_cart_add_inc &gt; select data.id, &gt; data.user_id, &gt; data.course_id, &gt; date_format(
错误1 hive (edu)&gt; insert into huanhuan values(1,&#39;haoge&#39;); Query ID = root_20240110071417_fe1517ad-3607-41f4-bdcf-d00b98ac443e Total jobs = 1
报错1:执行到如下就不执行了,没有显示Successfully registered new MBean. [root@slave1 bin]# /usr/local/software/flume-1.9.0/bin/flume-ng agent -n a1 -c /usr/local/softwa
虚拟及没有启动任何服务器查看jps会显示jps,如果没有显示任何东西 [root@slave2 ~]# jps 9647 Jps 解决方案 # 进入/tmp查看 [root@slave1 dfs]# cd /tmp [root@slave1 tmp]# ll 总用量 48 drwxr-xr-x. 2
报错1 hive&gt; show databases; OK Failed with exception java.io.IOException:java.lang.RuntimeException: Error in configuring object Time taken: 0.474 se
报错1 [root@localhost ~]# vim -bash: vim: 未找到命令 安装vim yum -y install vim* # 查看是否安装成功 [root@hadoop01 hadoop]# rpm -qa |grep vim vim-X11-7.4.629-8.el7_9.x
修改hadoop配置 vi /usr/local/software/hadoop-2.9.2/etc/hadoop/yarn-site.xml # 添加如下 &lt;configuration&gt; &lt;property&gt; &lt;name&gt;yarn.nodemanager.res