Shims ICE when a scalar argument isn't actually a scalar #3842
Labels
A-shims
Area: This affects the external function shims
C-bug
Category: This is a bug.
E-good-second-issue
A good issue to pick up if you've already seen some parts of Miri, mentoring is available
I-ICE
Impact: makes Miri crash with some ICE
For instance, consider:
I think to fix this properly we need to completely re-do the way we handle shim arguments: every
OpTy
needs to be transmuted to the right type before we do anything else with it. And we can't just just callOpTy::transmute
as that can't be used for arbitrary transmute, e.g. changing ABIs can fail spectacularly.Once this is consistently done everywhere, we can also remove the ScalarSizeMismatch error from the interpreter. This was added because otherwise ICEs can be triggered by using an incorrect scalar type in the signature of a function that has a Miri shim, but as we have seen, ICEs can still be triggered -- and once we use our own hard-coded types everywhere, ScalarSizeMismatch can no longer be triggered at all.
We probably want a macro that helps with that.
The text was updated successfully, but these errors were encountered: