guard against out-of-bounds jump table targets
This commit is contained in:
parent
3c52f2dccc
commit
7b866ae96d
1 changed files with 2 additions and 1 deletions
|
@ -1087,8 +1087,9 @@ void VM_Compile(vm_t *vm, vmHeader_t *header)
|
||||||
|
|
||||||
// ensure that the optimisation pass knows about all the jump
|
// ensure that the optimisation pass knows about all the jump
|
||||||
// table targets
|
// table targets
|
||||||
|
pc = -1; // a bogus value to be printed in out-of-bounds error messages
|
||||||
for( i = 0; i < vm->numJumpTableTargets; i++ ) {
|
for( i = 0; i < vm->numJumpTableTargets; i++ ) {
|
||||||
jused[ *(int *)(vm->jumpTableTargets + ( i * sizeof( int ) ) ) ] = 1;
|
JUSED( *(int *)(vm->jumpTableTargets + ( i * sizeof( int ) ) ) );
|
||||||
}
|
}
|
||||||
|
|
||||||
// Start buffer with x86-VM specific procedures
|
// Start buffer with x86-VM specific procedures
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue