Col-E/SimAnalyzer

Instruction tracking does not include void calls on objects

Open

#3 opened on Jul 30, 2020

View on GitHub
 (0 comments) (0 reactions) (0 assignees)Java (4 forks)github user discovery
bughelp wanted

Repository metrics

Stars
 (48 stars)
PR merge metrics
 (No merged PRs in 30d)

Description

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

Contributor guide