Page MenuHomePhabricator

Replacing to use of ul suffix in GetMaxU64Bitfield since it not guarenteed to be 64 bit

Authored by shafik on Dec 3 2019, 4:57 PM.



GetMaxU64Bitfield(...) uses the ul suffix but we require a 64 bit unsigned integer and ul could be 32 bit. So this replacing it with a explicit cast and refactors the code around it to use an early exit.

This bug came up in [[lldb-dev] Possible bug in DataExtractor::GetMaxU64Bitfield](

Diff Detail

Event Timeline

shafik created this revision.Dec 3 2019, 4:57 PM
JDevlieghere accepted this revision.Dec 4 2019, 9:08 AM
This revision is now accepted and ready to land.Dec 4 2019, 9:08 AM
teemperor accepted this revision.Dec 4 2019, 9:37 AM

LGTM minus a small nitpick. Thanks!


How about std::numeric_limits<uint64_t>::max()?

shafik updated this revision to Diff 232218.Dec 4 2019, 2:59 PM
shafik marked 2 inline comments as done.

Changing -static_cast<uint64_t>(1) to std::numeric_limits<uint64_t>::max()


Good call, I thought about this change too.

This revision was automatically updated to reflect the committed changes.
Herald added a project: Restricted Project. · View Herald TranscriptDec 5 2019, 10:05 AM