Skip to content

Temporary stack variable being stored as the wrong type #3224

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
public class External {
public void Accept(int... args) {

}
}
Binary file not shown.
12 changes: 12 additions & 0 deletions jbmc/regression/jbmc/temp_stack_variable_packing/Primary.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
public class Primary {
private External ex = new External();

public void Run() {
this.ex.Accept(new int[]{0, 1, 2});
assert(false);
}

public void main() {
this.Run();
}
}
7 changes: 7 additions & 0 deletions jbmc/regression/jbmc/temp_stack_variable_packing/test.desc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
CORE
Primary.class
--function Primary.main
^\[java::Primary.Run:\(\)V\.assertion\.1\] assertion at file Primary\.java line 6 function java::Primary.Run:\(\)V bytecode-index 22: FAILURE$
^VERIFICATION FAILED$
--
^warning: ignoring
3 changes: 2 additions & 1 deletion jbmc/src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3241,7 +3241,8 @@ void java_bytecode_convert_methodt::save_stack_entries(
}
if(replace)
{
create_stack_tmp_var(tmp_var_prefix, tmp_var_type, block, stack_entry);
create_stack_tmp_var(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No functional changes?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Style commit I just pushed got rid of the change for some reason - fixed now.

tmp_var_prefix, stack_entry.type(), block, stack_entry);
}
}
}
Expand Down