jakarta-bcel-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Huw Evans <...@dcs.gla.ac.uk>
Subject Re: checking
Date Tue, 01 Oct 2002 17:13:06 GMT

> here's the instruction list for that particular method that I got:
> 
> [0] getstatic[178](3) 14
> [1] ldc[18](2) 45
> [2] invokevirtual[182](3) 18
> [3] getstatic[178](3) 14
> [4] ldc[18](2) 46
> [5] invokevirtual[182](3) 18
> [6] goto[167](3) -> null
> [7] astore_1[76](1)
> [8] getstatic[178](3) 14
> [9] ldc[18](2) 47
> [10] invokevirtual[182](3) 18
> [11] getstatic[178](3) 14
> [12] ldc[18](2) 48
> [13] invokevirtual[182](3) 18
> [14] return[177](1)
> 
> Why does index 6 (the branch instruction)  point to null?  shouldn't it
> point to 11?  Is this a bug in BCEL or do I need to do something different
> to get the index of where the branch instruciton points to?

I have seen this as well, within the context of the switch bytecode statement 
after changing the bytecode after it that the contents of the switch branches 
to (due to the break keyword at the Java source level).

A suggestion for you is this: Ensure the bytecode that is at position 11 is 
inserted into the instruction list.  Then call redirect branches to redirect 
branches from the old instruction (at pos 11) to your new instruction.  The 
reference should not be null.  If you are already doing this, then I would 
suggest it is a bug.

This suggestion was made by Markus to me within the context of a switch 
statement.  However, for me it did not work.  I would like to know if it makes 
any difference for you.

I am not convinced this is not a bug, which is why I would like to know if you 
can see any difference.

Huw



--
To unsubscribe, e-mail:   <mailto:bcel-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:bcel-user-help@jakarta.apache.org>


Mime
View raw message