Skip to content

Commit

Permalink
Add extra comment about --nondet-static-exclude isssue
Browse files Browse the repository at this point in the history
Signed-off-by: Felipe R. Monteiro <felisous@amazon.com>
  • Loading branch information
feliperodri committed Mar 1, 2024
1 parent 84674d3 commit ba5d4c1
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions kani-compiler/src/codegen_cprover_gotoc/codegen/static_var.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,10 @@ impl<'tcx> GotocCtx<'tcx> {

let typ = self.codegen_ty_stable(instance.ty());
let location = self.codegen_span_stable(def.span());
// Contracts instrumentation relies on `--nondet-static-exclude` to properly
// havoc static variables. Kani uses the location and pretty name to identify
// the correct variables. If the wrong name is used, CBMC may fail silently.
// More details at https://github.com/diffblue/cbmc/issues/8225.
let symbol = Symbol::static_variable(symbol_name.clone(), symbol_name, typ, location)
.with_is_hidden(false) // Static items are always user defined.
.with_pretty_name(pretty_name);
Expand Down

0 comments on commit ba5d4c1

Please sign in to comment.