Skip to main content

A type declaration discussion when handling lookupswitch in jitir.c

No replies
pipi1889
Offline
Joined: 2004-11-05
Points: 0

Sometime segment fail occurs at /src/share/javavm/runtime/jit/jitir.c file when enable JIT. My code version is phoneme_advanced-mr2-dev-b136. After tracking, it occurs in handle for 'opc_lookupswitch' in translateRange method of jitir.c. The relative codes are as following:
"
...
CVMInt32 matchValue = CVMgetAlignedInt32(&lpc[2+2*gapEntry]);
CVMUint16 pcOffset = CVMgetAlignedInt32(&lpc[3+2*gapEntry]);
CVMJITIRBlock* targetbk = mc->pcToBlock[pc + pcOffset];
...
"

from the JVM spec description in http://java.sun.com/docs/books/jvms/second_edition/html/Instructions2.do...
about lookupswitch bytecode, I think the type of pcOffset should be CVMInt32, otherwise, if the offset is less than 0, "mc->pcToBlock[pc + pcOffset]" may have problem.

Has anyone encountered this situation?? Or some other better way to fix this segment fail. Thanks