Commit ba9787a0 authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh
Browse files

C++: Initialize memory after allocating symbol pointers



Change-Id: Ife1d3f963ef6781f96031f41ae3858b2c278145e
Reviewed-by: default avatarNikolai Kosjar <nikolai.kosjar@theqtcompany.com>
parent 5abfef60
......@@ -117,6 +117,7 @@ void SymbolTable::enterSymbol(Symbol *symbol)
_allocatedSymbols = DefaultInitialSize;
_symbols = reinterpret_cast<Symbol **>(realloc(_symbols, sizeof(Symbol *) * _allocatedSymbols));
memset(_symbols + _symbolCount, 0, sizeof(Symbol *) * (_allocatedSymbols - _symbolCount));
}
symbol->_index = _symbolCount;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment