harmony-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Alexei Fedotov" <alexei.fedo...@gmail.com>
Subject verification of unreachable code
Date Sun, 01 Apr 2007 15:00:13 GMT
Hello, Pavel, community,

Could you here help me to understand the following issue? Consider the
following example:
; test method
.method public test([Ljava/lang/String;)I
   .limit stack 3
   .limit locals 2

   sipush 555
   iconst_1 ; push int 1
   iconst_2 ; push int 2
   if_icmplt Next
   sipush 555
   if_icmpne Fail
   ; pass
   sipush 104

   sipush 105
   ireturn // <<<<<< look here

   return // <<<<<< look here
.end method

In VM validation test suite we have a big number of tests like this
which have several different return instructions one method. JVM spec
says about this: "Each return instruction must match its method's
return type." Strangely, Sun's verifier allows this code to pass
verification, probably due to the fact that invalid "return" statement
is unreachable.

Do you think we should be compatible with Sun on this issue?

With best regards,
ESSD, Intel

View raw message