Skip to content

Commit ad6a7a6

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

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/function.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,10 @@ 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!(value.iter().all(|attr| *attr >= 0));
85+
AttributeValue::IntArray(value)
86+
}
8487
}
8588
}
8689

0 commit comments

Comments
 (0)