Skip to content

Add bounds checking to runtime stack_pop and stack_peek #38

@tcrypt25519

Description

@tcrypt25519

Both stack_pop and stack_peek in crates/jet_runtime/src/exec.rs have commented-out bounds guards. Currently an underflow panics (or wraps in release) rather than returning a safe error.

  • exec.rs:141stack_pop: should return a second value (bool / Option / Result) indicating whether the pop was in-bounds.
  • exec.rs:152stack_peek: should return an error or None when peek_idx >= stack_ptr.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions