3

I am facing a problem in context of pushing a integer on stack in BCEL. I have a method _square of someClass i.e. "mathClass"

    ilist = new InstructionList();
    ilist.append(InstructionConstants.ALOAD_0);
    ilist.append(new GETFIELD(findex));
   //I am trying to push some value using createLoad but it is not working 

     ilist.append(InstructionConstants.ALOAD_1);
    ilist.append(ifact.createInvoke("mathClass", _square, Type.INT,
       new Type[] { Type.INT }, Constants.INVOKEVIRTUAL));

thanks

zaree
  • 641
  • 2
  • 6
  • 15

1 Answers1

1

I use

new InstructionList.append(new PUSH(constantPool,23));

the push method use to push primitive type data on stack.

ppeterka
  • 20,583
  • 6
  • 63
  • 78
zaree
  • 641
  • 2
  • 6
  • 15