COMP: hash-table size overflow with 64-bit labels (fixes #498)

- Requires (1L << N) instead of (1 << N), otherwise it overflows
  and the result is zero.
This commit is contained in:
Mark Olesen
2017-06-14 12:54:38 +02:00
parent 6d649ddf1f
commit 710f23aa35
3 changed files with 10 additions and 11 deletions

View File

@ -92,14 +92,14 @@ int main()
std::cout<< "max = " << pTraits<label>::max << nl;
std::cout<< "umax = " << pTraits<uLabel>::max << nl;
std::cout<< "max_2 = " << pTraits<label>::max/2 << " == "
<< (1 << (sizeof(label)*8-2)) << nl;
std::cout<< "max_2 = " << pTraits<label>::max/2 << " <=> "
<< (1L << (sizeof(label)*8-2)) << nl;
std::cout<< "max_4 = " << pTraits<label>::max/4 << " == "
<< (1 << (sizeof(label)*8-3)) << nl;
std::cout<< "max_4 = " << pTraits<label>::max/4 << " <=> "
<< (1L << (sizeof(label)*8-3)) << nl;
std::cout<< "max_8 = " << pTraits<label>::max/8 << " == "
<< (1 << (sizeof(label)*8-4)) << nl;
std::cout<< "max_8 = " << pTraits<label>::max/8 << " <=> "
<< (1L << (sizeof(label)*8-4)) << nl;
Info<< "End\n" << endl;