Bytecode: LOOKUPSWITCH and TABLESWITCH

I am currently using bytecode using BCEL. In the BCEL API, two types of LOOKUPSWITCH and TABLESWITCH ( package org.apache.bcel.generic ) implement the StackProducer interface. I know that these two instructions call the operand stack (i.e., Consume it) and do nothing on the stack, so how do they implement the StackProducer instead of the StackConsumer ? This is mistake? Thanks you

(ps: I tried posting this question on the BCEL mailing list without an answer. I hope I find more luck here)

+4
source share
1 answer

It was a mistake . But this was fixed some time ago.

 tree:generic jbevain$ svn log -c 1081190 && svn diff -c 1081190 ------------------------------------------------------------------------ r1081190 | dbrosius | 2011-03-13 19:41:20 +0100 (Sun, 13 Mar 2011) | 1 line Bug 48908 - Select instructions should implement StackConsumer instead of StackProducer ------------------------------------------------------------------------ Index: Select.java =================================================================== --- Select.java (revision 1081189) +++ Select.java (revision 1081190) @@ -33,7 +33,7 @@ * @see InstructionList */ public abstract class Select extends BranchInstruction implements VariableLengthInstruction, - StackProducer { + StackConsumer { private static final long serialVersionUID = 2806771744559217250L; protected int[] match; // matches, ie, case 1: ... 

Select is the base class for LOOKUPSWITCH and TABLESWITCH .

+3
source

Source: https://habr.com/ru/post/1303163/


All Articles