سؤال

أواجه مشكلة في سياق دفع عدد صحيح على المكدس في BCEL.لدي طريقة _مربع من بعض الفئة أي."صف الرياضيات"

    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));

شكرًا

هل كانت مفيدة؟

المحلول

أنا أستعمل

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

تُستخدم طريقة الدفع لدفع بيانات النوع البدائي إلى المكدس.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top