Skip to content

Avoid default constructing code_{assert,assume}t [blocks: #3800] #3934

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 1 commit into from
Jan 28, 2019
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
6 changes: 2 additions & 4 deletions jbmc/src/java_bytecode/java_bytecode_convert_method.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2313,16 +2313,14 @@ void java_bytecode_convert_methodt::convert_athrow(
// we translate athrow into
// ASSERT false;
// ASSUME false:
code_assertt assert_code;
assert_code.assertion() = false_exprt();
code_assertt assert_code(false_exprt{});
source_locationt assert_location = location; // copy
assert_location.set_comment("assertion at " + location.as_string());
assert_location.set("user-provided", true);
assert_location.set_property_class(ID_assertion);
assert_code.add_source_location() = assert_location;

code_assumet assume_code;
assume_code.assumption() = false_exprt();
code_assumet assume_code(false_exprt{});
source_locationt assume_location = location; // copy
assume_location.set("user-provided", true);
assume_code.add_source_location() = assume_location;
Expand Down
2 changes: 1 addition & 1 deletion src/goto-instrument/wmm/shared_buffers.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -320,7 +320,7 @@ void shared_bufferst::write(
target=goto_program.insert_before(target);
target->guard=cond_expr;
target->type=ASSERT;
target->code=code_assertt();
target->code = code_assertt(cond_expr);
target->code.add_source_location()=source_location;
target->source_location=source_location;
target++;
Expand Down