Add regression test for static field from missing class#8762
Open
tautschnig wants to merge 1 commit intodiffblue:developfrom
Open
Add regression test for static field from missing class#8762tautschnig wants to merge 1 commit intodiffblue:developfrom
tautschnig wants to merge 1 commit intodiffblue:developfrom
Conversation
Add a regression test verifying that static fields accessed via getstatic bytecode from a missing class are properly marked with is_static_lifetime and nondet-initialized. The underlying issue was already fixed by the create_stub_global_symbol function (commit e163ab6, Feb 2018), which correctly sets is_static_lifetime=true for stub globals. This test guards against regressions. Fixes: diffblue#851 Co-authored-by: Kiro <kiro-agent@users.noreply.github.com>
3d9e3a3 to
eabdff5
Compare
There was a problem hiding this comment.
Pull request overview
Adds a new JBMC regression test intended to guard against regressions where a getstatic access to a static field of a missing class fails to create a proper stub global (with is_static_lifetime set) and fails to nondet-initialize it.
Changes:
- Add a new regression directory
static_field_missing_class/with a minimal Java program that reads a static field from a missing class. - Add a
test.descexpecting an assertion failure and a warning. - Check in the precompiled
a.classartifact for the regression.
Reviewed changes
Copilot reviewed 2 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| jbmc/regression/jbmc/static_field_missing_class/test.desc | Adds a regression harness entry to run JBMC and match expected output. |
| jbmc/regression/jbmc/static_field_missing_class/a.java | Adds the Java source corresponding to the test scenario (missing class static field access). |
| jbmc/regression/jbmc/static_field_missing_class/a.class | Adds the compiled bytecode used by the regression test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3
to
+7
| --function a.fun | ||
| ^EXIT=10$ | ||
| ^SIGNAL=0$ | ||
| ^VERIFICATION FAILED$ | ||
| assertion at file a.java line 3 .*: FAILURE |
| public static void fun() { | ||
| assert b.x > 0; | ||
| } | ||
| } |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a regression test verifying that static fields accessed via getstatic bytecode from a missing class are properly marked with is_static_lifetime and nondet-initialized. The underlying issue was already fixed by the create_stub_global_symbol function (commit e163ab6, Feb 2018), which correctly sets is_static_lifetime=true for stub globals. This test guards against regressions.
Fixes: #851