miri: Detect uninitialized integers and floats by camelid · Pull Request #88670...
source link: https://github.com/rust-lang/rust/pull/88670
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
@@ -212,6 +212,10 @@ struct ValidityVisitor<'rt, 'mir, 'tcx, M: Machine<'mir, 'tcx>> {
}
impl<'rt, 'mir, 'tcx: 'mir, M: Machine<'mir, 'tcx>> ValidityVisitor<'rt, 'mir, 'tcx, M> {
fn allow_uninit_and_ptr_numbers(&self) -> bool {
!M::enforce_number_initialization(self.ecx)
One thing that might be confusing about this is that enforce_number_initialization
also controls whether pointer numbers are allowed. Should I rename enforce_number_initialization
to something like enforce_number_validity
(and maybe rename the Miri-the-tool flag too)?
I like enforce_number_validity. :)
Also, what is the point of introducing fn allow_uninit_and_ptr_numbers
here?
I like enforce_number_validity. :)
Ok, I'll rename to that :)
One thing though: will it be confusing because enforce_validity
also exists?
Also, what is the point of introducing
fn allow_uninit_and_ptr_numbers
here?
It's not really necessary anymore; I'll remove it.
One thing though: will it be confusing because enforce_validity also exists?
On a broad level it seems consistent. It gets a bit subtle but I think we can handle this with comments/documentation.
Yeah, and if we have to, we can rename the flag later too. Anyway, I updated this PR and the miri PR with the rename :)
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK