-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Should we put a log::trace!
before every unwrap_validated()
?
#64
Comments
log::trace!
before every unwrap_validated()
log::trace!
before every unwrap_validated()
?
Instead of having a A possible implementiation for pub fn unwrap_validated(self, reason: impl Display) {
log::trace!("Unwrapping Option because of prior validation. Reasoning: {msg}");
self.unwrap_or_else(||
panic!("Validation guarantees this to be `Some(_)`, but it is `None`. Reason this should have been safe to unwrap: {reason}")
)
} Here is also an example of how this could be called: GLOBAL_GET => {
let global_idx = wasm.read_var_u32(
.unwrap_validated("The GLOBAL_GET instruction should be followed by a 32-bit integer.") as GlobalIdx;
let global = store.globals.get(global_idx)
.unwrap_validated("The global index a GLOBAL_GET instruction should be valid");
stack.push_value(global.value.clone());
} However, now the naming |
|
I feel like |
No description provided.
The text was updated successfully, but these errors were encountered: