Skip to content

Commit 70e7697

Browse files
authored
Merge pull request #500 from filecoin-project/fix/abort-abort
fix: abort if aborting fails
2 parents d64d89e + 7aee08f commit 70e7697

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

sdk/src/sys/mod.rs

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -156,7 +156,12 @@ macro_rules! fvm_syscalls {
156156
}
157157

158158
syscall($($args),*);
159-
panic!(concat!("syscall ", stringify!($name), " should not have returned"))
159+
160+
// This should be unreachable unless the syscall has a bug. We abort instead of panicing
161+
// to help the compiler optimize. It has no way of _proving_ that the syscall doesn't
162+
// return, so this gives it a way to prove that even if the syscall does return, this
163+
// function won't.
164+
std::process::abort()
160165
}
161166
$crate::sys::fvm_syscalls! {
162167
module = $module;

0 commit comments

Comments
 (0)