1
Fork 0

abort immediately on bad mem::zeroed/uninit

This commit is contained in:
Ralf Jung 2022-12-21 13:49:48 +01:00
parent 2d8651a927
commit 9f241b3a26
9 changed files with 55 additions and 34 deletions

View file

@ -843,7 +843,7 @@ impl<'a, 'tcx> MirVisitor<'tcx> for MirNeighborCollector<'a, 'tcx> {
mir::TerminatorKind::Abort { .. } => {
let instance = Instance::mono(
tcx,
tcx.require_lang_item(LangItem::PanicNoUnwind, Some(source)),
tcx.require_lang_item(LangItem::PanicCannotUnwind, Some(source)),
);
if should_codegen_locally(tcx, &instance) {
self.output.push(create_fn_mono_item(tcx, instance, source));