Skip to content

Commit 767003e

Browse files
committed
Temporary stack variable should be the type of its previous object
In certain situations the stack of tmp_var's had the wrong type associated with it, as each replacement entry was being created with the type of the expression it was built from. In this particular case a java array created and directly passed into a method was causing the 'this' temp variable to be stored as the type of the array itself, causing an assertion error further on. The type of code causing this error: this.objectInstance.Method(new int[]{0, 1, 2});
1 parent 4455dee commit 767003e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3241,7 +3241,8 @@ void java_bytecode_convert_methodt::save_stack_entries(
32413241
}
32423242
if(replace)
32433243
{
3244-
create_stack_tmp_var(tmp_var_prefix, tmp_var_type, block, stack_entry);
3244+
create_stack_tmp_var(
3245+
tmp_var_prefix, stack_entry.type(), block, stack_entry);
32453246
}
32463247
}
32473248
}

0 commit comments

Comments
 (0)