Fixed a bug in the SymbolsTable where it wouldn't update its size.
This commit is contained in:
+2
-1
@@ -52,7 +52,7 @@ Symbol* TryGetSymbol(char* name, SymbolTable* table) {
|
||||
}
|
||||
|
||||
Symbol* AddSymbolToTable(char* name, void* value, int length, SymbolTable* table) {
|
||||
if (!name || !value || !table || length == 0) return NULL;
|
||||
//if (!name || !value || !table || length == 0) return NULL;
|
||||
|
||||
for(int i = 0; i < table->Size; i++) {
|
||||
if (strcmp(table->Symbols[i]->Name, name) == 0) {
|
||||
@@ -78,6 +78,7 @@ Symbol* AddSymbolToTable(char* name, void* value, int length, SymbolTable* table
|
||||
Symbol* symbol = CreateSymbol(name, value, length);
|
||||
|
||||
table->Symbols[table->Size] = symbol;
|
||||
table->Size++;
|
||||
|
||||
return symbol;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user