-
Notifications
You must be signed in to change notification settings - Fork 100
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix generator layout and sizes (#1607)
- Loading branch information
Showing
9 changed files
with
41 additions
and
21 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// Copyright Kani Contributors | ||
// SPDX-License-Identifier: Apache-2.0 OR MIT | ||
// | ||
// compile-flags: --edition 2018 | ||
|
||
// Regression test for /~https://github.com/model-checking/kani/issues/1593 | ||
// The problem was that the size of a generator was wrong, which was discovered | ||
// in the context of vtables. | ||
|
||
use std::sync::{ | ||
atomic::{AtomicI64, Ordering}, | ||
Arc, | ||
}; | ||
|
||
#[kani::proof] | ||
fn issue_1593() { | ||
let x = Arc::new(AtomicI64::new(0)); | ||
let x2 = x.clone(); | ||
let gen = async move { | ||
async {}.await; | ||
x2.fetch_add(1, Ordering::Relaxed); | ||
}; | ||
assert_eq!(std::mem::size_of_val(&gen), 16); | ||
let pinbox = Box::pin(gen); // check that vtables work | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.