kamleshbhalui wrote:

> This uses `DataExtractor::GetMaxU64` which already does this under the hood. 
> What does this do that isn't already being done? It may help if you add a 
> test case to show what you are trying to fix.

The problem with GetMaxU64 is that it always returns uint64_t even though 
actual type was uint32_t, so when byteswap is performed it becomes invalid 
integer, to fixed this we need to store correct bitwidth not higher.
i.e.
Suppose there is actual 32 bit integer i.e. 0xffffffff
`GetMaxU64` will return 0x00000000ffffffff (prmoted to uint64_t from uint32_t)
 and when performing byteswap on this it becomes 0xffffffff00000000 which is 
invalid.


https://github.com/llvm/llvm-project/pull/81451
_______________________________________________
lldb-commits mailing list
lldb-commits@lists.llvm.org
https://lists.llvm.org/cgi-bin/mailman/listinfo/lldb-commits

Reply via email to