fix: Check stack depth to prevent stack overflows in create_memory_map

This commit is contained in:
6d7a 2024-03-24 10:19:25 +01:00
parent 7c1be82cd9
commit 142ef764ee
2 changed files with 48 additions and 16 deletions

View file

@ -2828,7 +2828,7 @@ fn unsized_local() {
#[test]
fn recursive_adt() {
check_answer(
check_fail(
r#"
//- minicore: coerce_unsized, index, slice
pub enum TagTree {
@ -2849,6 +2849,6 @@ fn recursive_adt() {
TAG_TREE
};
"#,
|b, _| assert_eq!(b[0] % 8, 0),
|e| matches!(e, ConstEvalError::MirEvalError(MirEvalError::StackOverflow)),
);
}