Skip to content

Commit 66a9a8e

Browse files
Ensure that all values in FnAttribute::NonNull are positive
1 parent d8e59cb commit 66a9a8e

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

src/function.rs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,13 @@ impl<'a> FnAttribute<'a> {
8080
| FnAttribute::Pure
8181
| FnAttribute::Const
8282
| FnAttribute::Weak => AttributeValue::None,
83-
FnAttribute::NonNull(ref value) => AttributeValue::IntArray(value),
83+
FnAttribute::NonNull(ref value) => {
84+
debug_assert!(
85+
value.iter().all(|attr| *attr > 0),
86+
"all values must be > 0 for non-null attribute",
87+
);
88+
AttributeValue::IntArray(value)
89+
}
8490
}
8591
}
8692

0 commit comments

Comments
 (0)