You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I noticed that the code for the wasi_p1 backend now uses Error::from_neg_error_code(). WASI preview 1 error codes are unsigned 16-bit integers in the witx definition, though they are passed as signed 32-bit integers at the WASM level. The error values start at 1 and go up, so the code < 0 check transforms all errors into Error::UNEXPECTED. I confirmed this by calling getrandom from within a runtime that had a custom random_get import. I think this will need a separate constructor method, similar to Error::from_uefi_code().
The text was updated successfully, but these errors were encountered:
I think it's easier to just negate the code and continue to use from_neg_error_code. In the PR I also added a check that the code is in the expected range.
I noticed that the code for the
wasi_p1
backend now usesError::from_neg_error_code()
. WASI preview 1 error codes are unsigned 16-bit integers in the witx definition, though they are passed as signed 32-bit integers at the WASM level. The error values start at 1 and go up, so thecode < 0
check transforms all errors intoError::UNEXPECTED
. I confirmed this by callinggetrandom
from within a runtime that had a customrandom_get
import. I think this will need a separate constructor method, similar toError::from_uefi_code()
.The text was updated successfully, but these errors were encountered: