Skip to content

Problem about DecodedLocalVariableOp.localVariable #8

Description

@comaniac

Hi,

I'm a new user of this package. I'm now trying to retrieve the information of local variables as the sample you show on the website http://stephane.godbillon.com/BytecodeParser/.

The problem I encountered when doing this is that I cannot get the local variable for LOAD instructions. Specifically, I use the following code to retrieve the information I want:

@Override
public void handle(Op op, int idx) {
  if ((op instanceof LocalVariableOpcode) == false)
    return ;

  LocalVariableOpcode lv = op.as(LocalVariableOpcode.class);
  LocalVariable lvInfo = lv.decode(context, idx).localVariable;
  System.out.println(idx + " " + lvInfo.toString() + ": " + lvInfo.name);
}

However, I got NullPointerException of lvInfo when parsing the instruction ILOAD 5 in my program. Is it due to some wrong manipulations or restrictions?

Thanks.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions