Skip to content

Commit 8a398ee

Browse files
authored
Merge pull request #3224 from JohnDumbell/jd/bugfix/temp_variable_type_wrong
Temporary stack variable being stored as the wrong type
2 parents 70b98fe + b9392c5 commit 8a398ee

File tree

6 files changed

+26
-1
lines changed

6 files changed

+26
-1
lines changed
Binary file not shown.
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
public class External {
2+
public void Accept(int... args) {
3+
4+
}
5+
}
Binary file not shown.
Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
public class Primary {
2+
private External ex = new External();
3+
4+
public void Run() {
5+
this.ex.Accept(new int[]{0, 1, 2});
6+
assert(false);
7+
}
8+
9+
public void main() {
10+
this.Run();
11+
}
12+
}
Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
CORE
2+
Primary.class
3+
--function Primary.main
4+
^\[java::Primary.Run:\(\)V\.assertion\.1\] assertion at file Primary\.java line 6 function java::Primary.Run:\(\)V bytecode-index 22: FAILURE$
5+
^VERIFICATION FAILED$
6+
--
7+
^warning: ignoring

jbmc/src/java_bytecode/java_bytecode_convert_method.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3237,7 +3237,8 @@ void java_bytecode_convert_methodt::save_stack_entries(
32373237
}
32383238
if(replace)
32393239
{
3240-
create_stack_tmp_var(tmp_var_prefix, tmp_var_type, block, stack_entry);
3240+
create_stack_tmp_var(
3241+
tmp_var_prefix, stack_entry.type(), block, stack_entry);
32413242
}
32423243
}
32433244
}

0 commit comments

Comments
 (0)