diff --git a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/AsmMethodSource.java b/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/AsmMethodSource.java index 3c84cbaa119..adee45052ad 100644 --- a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/AsmMethodSource.java +++ b/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/AsmMethodSource.java @@ -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; } diff --git a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/Operand.java b/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/Operand.java index 5f185ce9224..a2ef2b58853 100644 --- a/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/Operand.java +++ b/sootup.java.bytecode/src/main/java/sootup/java/bytecode/frontend/Operand.java @@ -67,7 +67,7 @@ class Operand { Local getOrAssignValueToStackLocal() { if (stackLocal == null) { - changeStackLocal(methodSource.newStackLocal()); + changeStackLocal(methodSource.newStackLocal(value.getType())); } return stackLocal;