Skip to content
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

Codegen storage markers as assignments to __CPROVER_dead_object #3164

Closed
Closed
Show file tree
Hide file tree
Changes from 1 commit
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
Prev Previous commit
Revert #3080 except for std enablement
  • Loading branch information
tautschnig committed Apr 26, 2024
commit e3d1568e9bcb3b6c1538bff368c4ab6095cd8e09
3 changes: 0 additions & 3 deletions kani-compiler/src/args.rs
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,6 @@ pub struct Arguments {
/// Enable specific checks.
#[clap(long)]
pub ub_check: Vec<ExtraChecks>,
/// Ignore storage markers.
#[clap(long)]
pub ignore_storage_markers: bool,
}

#[derive(Debug, Clone, Copy, AsRefStr, EnumString, VariantNames, PartialEq, Eq)]
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -76,9 +76,7 @@ impl<'tcx> GotocCtx<'tcx> {
self.codegen_set_discriminant(dest_ty, dest_expr, *variant_index, location)
}
StatementKind::StorageLive(var_id) => {
if self.queries.args().ignore_storage_markers
|| !self.current_fn().is_address_taken_local(*var_id)
{
if !self.current_fn().is_address_taken_local(*var_id) {
Stmt::skip(location)
} else {
let global_dead_object = self.ensure_global_var(
Expand All @@ -102,9 +100,7 @@ impl<'tcx> GotocCtx<'tcx> {
}
}
StatementKind::StorageDead(var_id) => {
if self.queries.args().ignore_storage_markers
|| !self.current_fn().is_address_taken_local(*var_id)
{
if !self.current_fn().is_address_taken_local(*var_id) {
Stmt::skip(location)
} else {
let global_dead_object = self.ensure_global_var(
Expand Down
8 changes: 0 additions & 8 deletions kani-driver/src/args/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -252,14 +252,6 @@ pub struct VerificationArgs {
#[arg(long, hide_short_help = true, requires("enable_unstable"))]
pub ignore_global_asm: bool,

/// Ignore lifetimes of local variables. This effectively extends their
/// lifetimes to the function scope, and hence may cause Kani to miss
/// undefined behavior resulting from using the variable after it dies.
/// This option may impact the soundness of the analysis and may cause false
/// proofs and/or counterexamples
#[arg(long, hide_short_help = true, requires("enable_unstable"))]
pub ignore_locals_lifetime: bool,

/// Write the GotoC symbol table to a file in JSON format instead of goto binary format.
#[arg(long, hide_short_help = true)]
pub write_json_symtab: bool,
Expand Down
4 changes: 0 additions & 4 deletions kani-driver/src/call_single_file.rs
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,6 @@ impl KaniSession {
flags.push("--ub-check=validity".into())
}

if self.args.ignore_locals_lifetime {
flags.push("--ignore-storage-markers".into())
}

flags.extend(self.args.common_args.unstable_features.as_arguments().map(str::to_string));

// This argument will select the Kani flavour of the compiler. It will be removed before
Expand Down
5 changes: 0 additions & 5 deletions tests/perf/btreeset/insert_any/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

# Temporarily ignore the handling of storage markers till
# https://github.com/model-checking/kani/issues/3099 is fixed
[package.metadata.kani]
flags = { ignore-locals-lifetime = true, enable-unstable = true }
5 changes: 0 additions & 5 deletions tests/perf/btreeset/insert_multi/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

# Temporarily ignore the handling of storage markers till
# https://github.com/model-checking/kani/issues/3099 is fixed
[package.metadata.kani]
flags = { ignore-locals-lifetime = true, enable-unstable = true }
5 changes: 0 additions & 5 deletions tests/perf/btreeset/insert_same/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,3 @@ edition = "2021"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]

# Temporarily ignore the handling of storage markers till
# https://github.com/model-checking/kani/issues/3099 is fixed
[package.metadata.kani]
flags = { ignore-locals-lifetime = true, enable-unstable = true }
5 changes: 0 additions & 5 deletions tests/perf/hashset/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,3 @@ description = "Verify HashSet basic behavior"

[package.metadata.kani.unstable]
stubbing = true

# Temporarily ignore the handling of storage markers till
# https://github.com/model-checking/kani/issues/3099 is fixed
[package.metadata.kani]
flags = { ignore-locals-lifetime = true, enable-unstable = true }
Loading