Auto merge of #131006 - RalfJung:immediate-sanity, r=saethlin
interpret: always enable write_immediate sanity checks Writing a wrongly-sized scalar somewhere can have quite confusing effects. Let's see how expensive it is to catch this early.
This commit is contained in:
commit
9c7013c15c
2 changed files with 6 additions and 3 deletions
|
@ -118,6 +118,7 @@ impl<Prov: Provenance> Immediate<Prov> {
|
|||
(Immediate::Scalar(scalar), Abi::Scalar(s)) => {
|
||||
assert_eq!(scalar.size(), s.size(cx));
|
||||
if !matches!(s.primitive(), abi::Pointer(..)) {
|
||||
// This is not a pointer, it should not carry provenance.
|
||||
assert!(matches!(scalar, Scalar::Int(..)));
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue