Skip to content

Commit

Permalink
Remove panic converting NoInstructonsRemaining to OpaqeError
Browse files Browse the repository at this point in the history
  • Loading branch information
johnyob authored and sam-finch-tezos committed Nov 29, 2023
1 parent 8a2acf6 commit 41b24d5
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
4 changes: 2 additions & 2 deletions boa_engine/src/context/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -525,9 +525,9 @@ impl<'host> Context<'host> {
}

/// Get the remaining instruction count
#[cfg(freature = "fuzz")]
#[cfg(feature = "fuzz")]
#[inline]
pub const fn instructions_remaining(&self) -> u64 {
pub const fn instructions_remaining(&self) -> usize {
self.instructions_remaining
}
/// Get the [`RootShape`].
Expand Down
4 changes: 1 addition & 3 deletions boa_engine/src/error.rs
Original file line number Diff line number Diff line change
Expand Up @@ -819,9 +819,7 @@ impl JsNativeError {
JsNativeErrorKind::Uri => (constructors.uri_error().prototype(), ErrorKind::Uri),
#[cfg(feature = "fuzz")]
JsNativeErrorKind::NoInstructionsRemain => {
unreachable!(
"The NoInstructionsRemain native error cannot be converted to an opaque type."
)
(constructors.eval_error().prototype(), ErrorKind::Eval)
}
JsNativeErrorKind::RuntimeLimit => {
panic!("The RuntimeLimit native error cannot be converted to an opaque type.")
Expand Down

0 comments on commit 41b24d5

Please sign in to comment.