Fix jump table entry bounds check

This commit is contained in:
Ethan Lafrenais 2024-10-30 23:36:40 -04:00
parent 7449fad4bb
commit 21fe6f1c3c
No known key found for this signature in database
GPG key ID: 928A0136009E2745

View file

@ -344,7 +344,7 @@ bool N64Recomp::analyze_function(const N64Recomp::Context& context, const N64Rec
}
// Check if the entry is a valid address in the current function
if (jtbl_word < func.vram || jtbl_word > func.vram + func.words.size() * sizeof(func.words[0])) {
if (jtbl_word < func.vram || jtbl_word >= func.vram + func.words.size() * sizeof(func.words[0])) {
// If it's not then this is the end of the jump table
break;
}