mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
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:
@ -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;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user