From 3ea75a78631366c2cbc972e4e5abaccf562e90bf Mon Sep 17 00:00:00 2001 From: Chronos Ouroboros Date: Wed, 26 Aug 2020 18:16:04 -0300 Subject: [PATCH] Fixed an incorrect abort message on out of bounds array access. --- src/scripting/vm/jit_flow.cpp | 2 +- src/scripting/vm/vmexec.h | 6 +++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/scripting/vm/jit_flow.cpp b/src/scripting/vm/jit_flow.cpp index 5db91818a..8439481cf 100644 --- a/src/scripting/vm/jit_flow.cpp +++ b/src/scripting/vm/jit_flow.cpp @@ -310,7 +310,7 @@ void JitCompiler::ThrowArrayOutOfBounds(int index, int size) { if (index >= size) { - ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Max.index = %u, current index = %u\n", size, index); + ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Size = %u, current index = %u\n", size, index); } else { diff --git a/src/scripting/vm/vmexec.h b/src/scripting/vm/vmexec.h index 4afea831a..bbc3fedf7 100644 --- a/src/scripting/vm/vmexec.h +++ b/src/scripting/vm/vmexec.h @@ -802,7 +802,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret) OP(BOUND): if (reg.d[a] >= BC) { - ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Max.index = %u, current index = %u\n", BC, reg.d[a]); + ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Size = %u, current index = %u\n", BC, reg.d[a]); return 0; } else if (reg.d[a] < 0) @@ -816,7 +816,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret) ASSERTKD(BC); if (reg.d[a] >= konstd[BC]) { - ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Max.index = %u, current index = %u\n", konstd[BC], reg.d[a]); + ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Size = %u, current index = %u\n", konstd[BC], reg.d[a]); return 0; } else if (reg.d[a] < 0) @@ -830,7 +830,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret) ASSERTD(B); if (reg.d[a] >= reg.d[B]) { - ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Max.index = %u, current index = %u\n", reg.d[B], reg.d[a]); + ThrowAbortException(X_ARRAY_OUT_OF_BOUNDS, "Size = %u, current index = %u\n", reg.d[B], reg.d[a]); return 0; } else if (reg.d[a] < 0)