summaryrefslogtreecommitdiffstats
path: root/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
diff options
context:
space:
mode:
Diffstat (limited to 'Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c')
-rw-r--r--Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
index c5636b7..a17c319 100644
--- a/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
+++ b/Source/ThirdParty/ANGLE/src/compiler/preprocessor/atom.c
@@ -182,12 +182,13 @@ static int AddString(StringTable *stable, const char *s)
char *str;
len = (int) strlen(s);
- if (stable->nextFree + len + 1 >= stable->size) {
+ while (stable->nextFree + len + 1 >= stable->size) {
assert(stable->size < 1000000);
str = (char *) malloc(stable->size*2);
memcpy(str, stable->strings, stable->size);
free(stable->strings);
stable->strings = str;
+ stable->size = stable->size*2;
}
loc = stable->nextFree;
strcpy(&stable->strings[loc], s);
@@ -334,7 +335,7 @@ static int GrowAtomTable(AtomTable *atable, int size)
if (newmap)
atable->amap = newmap;
if (newrev)
- atable->amap = newrev;
+ atable->arev = newrev;
return -1;
}
memset(&newmap[atable->size], 0, (size - atable->size) * sizeof(int));