Skip to content

Commit 4897239

Browse files
authored
Handle OOM during System-V unwind registration (#12559)
1 parent 71c51d0 commit 4897239

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

  • crates/wasmtime/src/runtime/vm/sys/unix

crates/wasmtime/src/runtime/vm/sys/unix/unwind.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
use crate::prelude::*;
44
use crate::runtime::vm::SendSyncPtr;
55
use core::ptr::NonNull;
6+
use wasmtime_environ::collections::Vec;
67

78
/// Represents a registration of function unwind information for System V ABI.
89
pub struct UnwindRegistration {
@@ -97,7 +98,7 @@ impl UnwindRegistration {
9798
if current != start {
9899
__register_frame(current);
99100
let cur = NonNull::new(current.cast_mut()).unwrap();
100-
registrations.push(SendSyncPtr::new(cur));
101+
registrations.push(SendSyncPtr::new(cur))?;
101102
}
102103

103104
// Move to the next table entry (+4 because the length itself is
@@ -109,7 +110,7 @@ impl UnwindRegistration {
109110
// entry of length 0
110111
__register_frame(unwind_info);
111112
let info = NonNull::new(unwind_info.cast_mut()).unwrap();
112-
registrations.push(SendSyncPtr::new(info));
113+
registrations.push(SendSyncPtr::new(info))?;
113114
}
114115
}
115116

0 commit comments

Comments
 (0)