Skip to content

Swapped rhv and lhv in some JcRawConditionExprs #81

@volivan239

Description

@volivan239

Raw instructions are build incorrectly in org.jacodb.impl.cfg.RawInstListBuilder#buildJumpInsnNode: for Opcodes.IFLT, Opcoes.IFGE and others lhv and rhv are swapped.

To reproduce: build flowGraph for

int f(int x) {
    if (x < 0) {
        return 0;
    }
    return 1;
}

In the produced flowgraph, if turns into if (0 >= arg$0) with true branch return 1 and false branch return 0 (obviously, the condition in if should be arg$0 >= 0)

Exposed by @sergeypospelov

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions