mirror of
https://github.com/krgamestudios/Toy.git
synced 2026-04-15 23:04:08 +10:00
Found a weird bug, reporting it
This commit is contained in:
@@ -573,7 +573,7 @@ static bool execCompareLessEqual(Interpreter* interpreter, bool invert) {
|
||||
static bool execJump(Interpreter* interpreter) {
|
||||
int target = (int)readShort(interpreter->bytecode, &interpreter->count);
|
||||
|
||||
if (target >= interpreter->length) {
|
||||
if (target + interpreter->codeStart > interpreter->length) {
|
||||
printf("Jump out of range\n");
|
||||
return false;
|
||||
}
|
||||
@@ -587,7 +587,7 @@ static bool execJump(Interpreter* interpreter) {
|
||||
static bool execFalseJump(Interpreter* interpreter) {
|
||||
int target = (int)readShort(interpreter->bytecode, &interpreter->count);
|
||||
|
||||
if (target >= interpreter->length) {
|
||||
if (target + interpreter->codeStart > interpreter->length) {
|
||||
printf("Jump out of range\n");
|
||||
return false;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user