mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
Be paranoid about temp var sizes
Prevents array index errors.
This commit is contained in:
parent
28a2b96800
commit
bf0543f7fb
1 changed files with 3 additions and 0 deletions
|
@ -199,6 +199,9 @@ temp_def (etype_t type, int size)
|
|||
def_t *temp;
|
||||
defspace_t *space = current_func->symtab->space;
|
||||
|
||||
if (size < 1 || size > 4) {
|
||||
internal_error (0, "%d invalid size for temp def", size);
|
||||
}
|
||||
if ((temp = current_func->temp_defs[size - 1])) {
|
||||
current_func->temp_defs[size - 1] = temp->temp_next;
|
||||
temp->temp_next = 0;
|
||||
|
|
Loading…
Reference in a new issue