Skip to content

Commit

Permalink
Revert "chore: add more context to input stream panic (#1091)"
Browse files Browse the repository at this point in the history
This reverts commit acd5c7c.
  • Loading branch information
0xWOLAND committed Jul 18, 2024
1 parent 4e470c4 commit 37bb713
Showing 1 changed file with 2 additions and 10 deletions.
12 changes: 2 additions & 10 deletions core/src/syscall/hint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,7 @@ impl SyscallHintLen {
impl Syscall for SyscallHintLen {
fn execute(&self, ctx: &mut SyscallContext, _arg1: u32, _arg2: u32) -> Option<u32> {
if ctx.rt.state.input_stream_ptr >= ctx.rt.state.input_stream.len() {
panic!(
"failed reading stdin due to insufficient input data: input_stream_ptr={}, input_stream_len={}",
ctx.rt.state.input_stream_ptr,
ctx.rt.state.input_stream.len()
);
panic!("not enough vecs in hint input stream");
}
Some(ctx.rt.state.input_stream[ctx.rt.state.input_stream_ptr].len() as u32)
}
Expand All @@ -34,11 +30,7 @@ impl SyscallHintRead {
impl Syscall for SyscallHintRead {
fn execute(&self, ctx: &mut SyscallContext, ptr: u32, len: u32) -> Option<u32> {
if ctx.rt.state.input_stream_ptr >= ctx.rt.state.input_stream.len() {
panic!(
"failed reading stdin due to insufficient input data: input_stream_ptr={}, input_stream_len={}",
ctx.rt.state.input_stream_ptr,
ctx.rt.state.input_stream.len()
);
panic!("not enough vecs in hint input stream");
}
let vec = &ctx.rt.state.input_stream[ctx.rt.state.input_stream_ptr];
ctx.rt.state.input_stream_ptr += 1;
Expand Down

0 comments on commit 37bb713

Please sign in to comment.