[lldb-dev] Possible bug in DataExtractor::GetMaxU64Bitfield
Shafik Yaghmour via lldb-dev
lldb-dev at lists.llvm.org
Thu Dec 5 12:54:01 PST 2019
Ted,
This was a good catch! I landed a patch for this a little while ago:
https://reviews.llvm.org/D70992 <https://reviews.llvm.org/D70992>
Thank you
> On Nov 25, 2019, at 9:49 AM, Ted Woodward via lldb-dev <lldb-dev at lists.llvm.org> wrote:
>
> 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:
> https://developercommunity.visualstudio.com/content/problem/226112/vs2017-1ul-32-is-evaluated-to-0-in-watch-window-du.html <https://developercommunity.visualstudio.com/content/problem/226112/vs2017-1ul-32-is-evaluated-to-0-in-watch-window-du.html>
>
> Thoughts?
> _______________________________________________
> lldb-dev mailing list
> lldb-dev at lists.llvm.org <mailto:lldb-dev at lists.llvm.org>
> https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev <https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-dev>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/lldb-dev/attachments/20191205/6222a6f4/attachment.html>
More information about the lldb-dev
mailing list