Skip to content

Commit

Permalink
Add message to assertion
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacob Salzberg committed Aug 23, 2024
1 parent 4fd5842 commit a742547
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions library/kani/src/aliasing.rs
Original file line number Diff line number Diff line change
Expand Up @@ -60,8 +60,6 @@
use crate::mem::{pointer_object, pointer_offset};
use crate::shadow::ShadowMem;

#[allow(unused)]
const STACK_DEPTH: usize = 15;
type PointerTag = u8;

use super::*;
Expand Down Expand Up @@ -132,6 +130,9 @@ pub(super) mod monitors {
const OFF: bool = false;
}

#[allow(unused)]
const STACK_DEPTH: usize = 15;

/// Whether the monitor is on. Initially, the monitor is
/// "off", and it will remain so until an allocation is found
/// to track.
Expand Down Expand Up @@ -196,7 +197,7 @@ pub(super) mod monitors {
let mut found = false;
let mut j = 0;
let mut new_top = 0;
assert!(STACK_TOP < STACK_DEPTH);
crate::assert(STACK_TOP < STACK_DEPTH, "Max # of nested borrows (15) exceeded");
while j < STACK_DEPTH {
if j < STACK_TOP {
let id = STACK_TAGS[j];
Expand Down

0 comments on commit a742547

Please sign in to comment.