How do I overcome the “VerifyError:Expecting a stackmap frame” for a JDK 7/8 application?

后端 未结 2 946
自闭症患者
自闭症患者 2021-01-14 06:17

I am using ASM 5.0.3 bytecode modification library with Tomcat 8 and JDK 8.

My intention is to inject bytecode successfully into all the classes. However, I encount

2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-14 06:49

    Use the ClassWriter#COMPUTE_FRAMES flag for the stack map frames to be recomputed. The bytecode verifier uses typechecker (stack map) from JDK 7 on, so that's why your code works on JDK 6.

    Note that (from COMPUTE_FRAMES JavaDoc):

    computeFrames implies computeMaxs

提交回复
热议问题