]> git.lizzy.rs Git - rust.git/blobdiff - src/value_and_place.rs
Fix inline asm codegen for empty template
[rust.git] / src / value_and_place.rs
index 8ff35d2f76dbfb62c4c79b5ff9f1dbc3234343a1..d82de1d3d8d359c0aa7b4f8622032dd02b41ef34 100644 (file)
@@ -324,6 +324,12 @@ pub(crate) fn new_stack_slot(
             };
         }
 
+        if layout.size.bytes() >= u64::from(u32::MAX - 16) {
+            fx.tcx
+                .sess
+                .fatal(&format!("values of type {} are too big to store on the stack", layout.ty));
+        }
+
         let stack_slot = fx.bcx.create_stack_slot(StackSlotData {
             kind: StackSlotKind::ExplicitSlot,
             // FIXME Don't force the size to a multiple of 16 bytes once Cranelift gets a way to