We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 720b100 commit a85b205Copy full SHA for a85b205
1 file changed
crates/wasmtime/src/runtime/vm/gc/enabled/copying.rs
@@ -792,9 +792,13 @@ unsafe impl GcHeap for CopyingHeap {
792
length: u32,
793
layout: &GcArrayLayout,
794
) -> Result<Result<VMArrayRef, u64>> {
795
+ let layout = layout
796
+ .layout(length)
797
+ .ok_or_else(|| crate::Trap::AllocationTooLarge)?;
798
+
799
let gc_ref = match self.alloc_raw(
800
VMGcHeader::from_kind_and_index(VMGcKind::ArrayRef, ty),
- layout.layout(length),
801
+ layout,
802
)? {
803
Err(n) => return Ok(Err(n)),
804
Ok(gc_ref) => gc_ref,
0 commit comments