tcc_realloc: auto "memory full" error

This commit is contained in:
grischka
2012-04-18 18:43:55 +02:00
parent 3c59f84240
commit f1b5c2ef4f
3 changed files with 2 additions and 12 deletions

View File

@ -836,8 +836,6 @@ static void put_got_offset(TCCState *s1, int index, unsigned long val)
while (index >= n)
n *= 2;
tab = tcc_realloc(s1->got_offsets, n * sizeof(unsigned long));
if (!tab)
tcc_error("memory full");
s1->got_offsets = tab;
memset(s1->got_offsets + s1->nb_got_offsets, 0,
(n - s1->nb_got_offsets) * sizeof(unsigned long));