Fixed an incorrect abort message on out of bounds array access.

This commit is contained in:
Chronos Ouroboros 2020-08-26 18:16:04 -03:00 committed by drfrag
parent 643cba776b
commit 3ea75a7863
2 changed files with 4 additions and 4 deletions

View file

@ -310,7 +310,7 @@ void JitCompiler::ThrowArrayOutOfBounds(int index, int size)
{ {
if (index >= 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 else
{ {

View file

@ -802,7 +802,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
OP(BOUND): OP(BOUND):
if (reg.d[a] >= BC) 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; return 0;
} }
else if (reg.d[a] < 0) else if (reg.d[a] < 0)
@ -816,7 +816,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
ASSERTKD(BC); ASSERTKD(BC);
if (reg.d[a] >= konstd[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; return 0;
} }
else if (reg.d[a] < 0) else if (reg.d[a] < 0)
@ -830,7 +830,7 @@ static int ExecScriptFunc(VMFrameStack *stack, VMReturn *ret, int numret)
ASSERTD(B); ASSERTD(B);
if (reg.d[a] >= reg.d[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; return 0;
} }
else if (reg.d[a] < 0) else if (reg.d[a] < 0)