From 1e069931e814e5458d83749a71b5ca945d53d34c Mon Sep 17 00:00:00 2001
From: Delweng <delweng@gmail.com>
Date: Fri, 18 Oct 2024 01:42:39 +0800
Subject: [PATCH] fix(js): the opposite checking logic (#232)

Seems we're using the opposite judge logic to check the ending and
memory length. found in
https://github.com/paradigmxyz/revm-inspectors/actions/runs/11389609241/job/31689313431?pr=231

Signed-off-by: jsvisa <delweng@gmail.com>
---
 src/tracing/js/bindings.rs | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/src/tracing/js/bindings.rs b/src/tracing/js/bindings.rs
index 85b0d3a4..61162ccc 100644
--- a/src/tracing/js/bindings.rs
+++ b/src/tracing/js/bindings.rs
@@ -265,7 +265,7 @@ impl MemoryRef {
                 move |_this, args, memory, ctx| {
                     let start = args.get_or_undefined(0).to_number(ctx)?;
                     let end = args.get_or_undefined(1).to_number(ctx)?;
-                    if end < start || start < 0. || (end as usize) < memory.len() {
+                    if end < start || start < 0. || (end as usize) > memory.len() {
                         return Err(JsError::from_native(JsNativeError::typ().with_message(
                             format!(
                                 "tracer accessed out of bound memory: offset {start}, end {end}"