Skip to content

Commit

Permalink
Use information of operand value to determine type for java locals
Browse files Browse the repository at this point in the history
This PR uses the already existing information of the operand's value type to determine the type for java locals. Previously, most of the stack variables were of "unknown" type
.
Fixes #635
  • Loading branch information
oxisto committed Dec 31, 2023
1 parent 23e5a3e commit 726b6df
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -291,9 +291,14 @@ void setStmt(@Nonnull AbstractInsnNode insn, @Nonnull Stmt stmt) {

@Nonnull
Local newStackLocal() {
return newStackLocal(UnknownType.getInstance());
}

@Nonnull
Local newStackLocal(Type type) {
int idx = nextLocal++;
JavaLocal l =
JavaJimple.newLocal("$stack" + idx, UnknownType.getInstance(), Collections.emptyList());
JavaJimple.newLocal("$stack" + idx, type, Collections.emptyList());
locals.set(idx, l);
return l;
}
Expand Down

0 comments on commit 726b6df

Please sign in to comment.