Question

Je suis actuellement instrumentant bytecode en utilisant BCEL. Dans l'API BCEL, les deux types d'instructions LOOKUPSWITCH et TABLESWITCH (package org.apache.bcel.generic) mettent en œuvre StackProducer d'interface. Je sais que ces deux instructions pop la pile d'opérandes (à savoir la consomment) et ne produisent rien sur la pile, alors comment se fait-il mettre en œuvre StackProducer au lieu de StackConsumer? Est-ce un bug? Merci

(ps:. J'ai essayé de poster cette question sur la liste de diffusion BCEL sans réponse que j'espère que je vais trouver plus de chance ici)

Était-ce utile?

La solution

Il était un bug . Mais il a été fixé il y a maintenant un certain temps.

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, i.e., case 1: ...

Select est la classe de base pour LOOKUPSWITCH et TABLESWITCH.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top