Skip to content

Commit e5fcf6d

Browse files
committed
Reject system exit codes from abort
1 parent f4098eb commit e5fcf6d

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

fvm/src/syscalls/vm.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
use fvm_shared::error::ExitCode;
2+
use fvm_shared::version::NetworkVersion;
23

34
use super::error::Abort;
45
use super::Context;
@@ -18,13 +19,12 @@ pub fn abort(
1819
message_len: u32,
1920
) -> Result<Never, Abort> {
2021
let code = ExitCode::new(code);
21-
// Uncomment to fix https://github.com/filecoin-project/ref-fvm/issues/253
22-
// if code.is_system_error() {
23-
// return Err(Abort::Exit(
24-
// SystemExitCode::ILLEGAL_EXIT_CODE,
25-
// format!("actor aborted with code {}", code),
26-
// ));
27-
// }
22+
if context.kernel.network_version() >= NetworkVersion::V16 && code.is_system_error() {
23+
return Err(Abort::Exit(
24+
ExitCode::SYS_ILLEGAL_EXIT_CODE,
25+
format!("actor aborted with code {}", code),
26+
));
27+
}
2828

2929
let message = if message_len == 0 {
3030
"actor aborted".to_owned()

0 commit comments

Comments
 (0)