forked from lix-project/lix
* Fixed a subtle uninitialised variable bug in ATermMaps copied from
ATermMaps. Found thanks to Valgrind!
This commit is contained in:
parent
47f19b6293
commit
1109ea0680
|
@ -4,6 +4,7 @@
|
|||
|
||||
ATermMap::ATermMap(unsigned int initialSize, unsigned int maxLoadPct)
|
||||
{
|
||||
this->maxLoadPct = maxLoadPct;
|
||||
table = ATtableCreate(initialSize, maxLoadPct);
|
||||
if (!table) throw Error("cannot create ATerm table");
|
||||
}
|
||||
|
@ -15,7 +16,8 @@ ATermMap::ATermMap(const ATermMap & map)
|
|||
ATermList keys = map.keys();
|
||||
|
||||
/* !!! adjust allocation for load pct */
|
||||
table = ATtableCreate(ATgetLength(keys), map.maxLoadPct);
|
||||
maxLoadPct = map.maxLoadPct;
|
||||
table = ATtableCreate(ATgetLength(keys), maxLoadPct);
|
||||
if (!table) throw Error("cannot create ATerm table");
|
||||
|
||||
for (ATermIterator i(keys); i; ++i)
|
||||
|
|
Loading…
Reference in a new issue