Skip to content

Commit e6142a4

Browse files
authored
Remove PtrWrite hook (rust-lang#1176)
* Remove PtrWrite hook * Bump CBMC version
1 parent 872ba52 commit e6142a4

File tree

2 files changed

+1
-36
lines changed

2 files changed

+1
-36
lines changed

kani-compiler/src/codegen_cprover_gotoc/overrides/hooks.rs

Lines changed: 0 additions & 35 deletions
Original file line numberDiff line numberDiff line change
@@ -282,40 +282,6 @@ impl<'tcx> GotocHook<'tcx> for PtrRead {
282282
}
283283
}
284284

285-
struct PtrWrite;
286-
287-
impl<'tcx> GotocHook<'tcx> for PtrWrite {
288-
fn hook_applies(&self, tcx: TyCtxt<'tcx>, instance: Instance<'tcx>) -> bool {
289-
let name = with_no_trimmed_paths!(tcx.def_path_str(instance.def_id()));
290-
name == "core::ptr::write"
291-
|| name == "core::ptr::write_unaligned"
292-
|| name == "std::ptr::write"
293-
|| name == "std::ptr::write_unaligned"
294-
}
295-
296-
fn handle(
297-
&self,
298-
tcx: &mut GotocCtx<'tcx>,
299-
_instance: Instance<'tcx>,
300-
mut fargs: Vec<Expr>,
301-
_assign_to: Place<'tcx>,
302-
target: Option<BasicBlock>,
303-
span: Option<Span>,
304-
) -> Stmt {
305-
let loc = tcx.codegen_span_option(span);
306-
let target = target.unwrap();
307-
let dst = fargs.remove(0);
308-
let src = fargs.remove(0);
309-
Stmt::block(
310-
vec![
311-
dst.dereference().assign(src, loc).with_location(loc),
312-
Stmt::goto(tcx.current_fn().find_label(&target), loc),
313-
],
314-
loc,
315-
)
316-
}
317-
}
318-
319285
struct RustAlloc;
320286
// Removing this hook causes regression failures.
321287
// https://github.com/model-checking/kani/issues/1170
@@ -397,7 +363,6 @@ pub fn fn_hooks<'tcx>() -> GotocHooks<'tcx> {
397363
Rc::new(ExpectFail),
398364
Rc::new(Nondet),
399365
Rc::new(PtrRead),
400-
Rc::new(PtrWrite),
401366
Rc::new(RustAlloc),
402367
Rc::new(SliceFromRawPart),
403368
],

scripts/kani-regression.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ KANI_DIR=$SCRIPT_DIR/..
1919
export KANI_FAIL_ON_UNEXPECTED_DESCRIPTION="true"
2020

2121
# Required dependencies
22-
check-cbmc-version.py --major 5 --minor 60
22+
check-cbmc-version.py --major 5 --minor 61
2323
check-cbmc-viewer-version.py --major 3 --minor 5
2424

2525
# Formatting check

0 commit comments

Comments
 (0)