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