Bytecode optimizer causes preverification to fail
Status: Beta
Brought to you by:
hchacha
When jarg with bytecode optimizing option is turned on,
I had one of my class file failing the preverification (sorry,
I can't submit the code since it's not really mine.)
The error message from preverifier is as follows:
----------------------------
Error preverifying class b
VERIFIER ERROR b.qa()I:
Unable to pop operand off an empty stack
----------------------------
Following is as far as I know now:
----------------------------
In the method jarg.BytecodeOptimizer#optimizeCode, if I
commented out the line that says:
counter += analizeLocalSlot();
(replacing xSTOREn to POP?) then I don't get the error
anymore.
----------------------------
Do you have any clue?
Logged In: YES
user_id=796025
JARg'd JAR files tend to fail in the preverification stage
here as well.
Here's the sort of error I'm getting:
Running with storage root DefaultColorPhone
Error verifying method tilt/arena/Arena d(I)V
Approximate bytecode offset 9: Inconsistent or missing
stackmap at target
ALERT: Error verifying class tilt/arena/Arena
I expect avoiding removing preverification attributes and
not interfering with preverification has not been given
a high priority up until this point.
Logged In: YES
user_id=796025
My verification problem was due to me not using the correct
command to run Jarg.
After reading the documentation, using:
java -jar C:\Incoming\Java\JARG\jarg.jar -j2me-prev
C:\Program1\Java\WTK20\bin\preverify.exe -j2me-cp
C:\Program1\Java\WTK20\lib\midpapi.zip tilt.jar
...produces a jar file that works OK.