Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Instruction tracking does not include void calls on objects #3

Open
Col-E opened this issue Jul 30, 2020 · 0 comments
Open

Instruction tracking does not include void calls on objects #3

Col-E opened this issue Jul 30, 2020 · 0 comments
Labels
bug Something isn't working help wanted Extra attention is needed

Comments

@Col-E
Copy link
Owner

Col-E commented Jul 30, 2020

Given the following example:

NEW Type
DUP
INVOKESPECIAL Type.<init>()V
INVOKEVOID Type.enableThing()V
ASTORE t
ALOAD t
ARETURN

The tracked instructions will not include the constructor or void call.

  • Type.<init>()V
  • Type.enableThing()V

This is not a clear edge-case fix since ASM tosses values of invoke calls that return void. This is done in Frame#executeInvokeInsn(...)

  private void executeInvokeInsn(AbstractInsnNode insn, final String desc, final Interpreter<V> interpreter) {
// ... snip
    if (Type.getReturnType(methodDescriptor) == Type.VOID_TYPE) {
      interpreter.naryOperation(insn, valueList);
    } else {
      push(interpreter.naryOperation(insn, valueList));
    }
  }

There is a test case that asserts the current behavior: TestInstructionTracking

@Col-E Col-E added bug Something isn't working help wanted Extra attention is needed labels Jul 30, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant