Possible bug in DataExtractor::GetMaxU64Bitfield

Here’s an interesting bug, in source/Utility/DataExtractor.cpp, DataExtractor::GetMaxU64Bitfield:

uint64_t bitfield_mask = ((1ul << bitfield_bit_size) - 1);

In Visual Studio 2017, ul is a 32 bit type. When I run it with a size of 36 (from large_packed in test/API/lang/c/bitfields/main.c), I get a mask of 0x0f.

I think that should be 1ull, or (uint64_t) 1, not 1ul.

MSDN problem talking about the size of ul:




This was a good catch! I landed a patch for this a little while ago:


Thank you