[Lldb-commits] [lldb] r220022 - A << operation would be undefined for a bit-selecting

Jason Molenda jmolenda at apple.com
Thu Oct 16 18:52:30 PDT 2014


Author: jmolenda
Date: Thu Oct 16 20:52:30 2014
New Revision: 220022

URL: http://llvm.org/viewvc/llvm-project?rev=220022&view=rev
Log:
A << operation would be undefined for a bit-selecting
function because of a '1u' making it a 32-bit value
when it really needed to be a 64-bit value.  Trivial to fix
once I figured out what was going on.
clang static analzyer fixit.

Modified:
    lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h

Modified: lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h?rev=220022&r1=220021&r2=220022&view=diff
==============================================================================
--- lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h (original)
+++ lldb/trunk/source/Plugins/Process/Utility/InstructionUtils.h Thu Oct 16 20:52:30 2014
@@ -20,7 +20,7 @@ static inline uint64_t
 Bits64 (const uint64_t bits, const uint32_t msbit, const uint32_t lsbit)
 {
     assert(msbit < 64 && lsbit <= msbit);
-    return (bits >> lsbit) & ((1u << (msbit - lsbit + 1)) - 1);
+    return (bits >> lsbit) & ((1ull << (msbit - lsbit + 1)) - 1);
 }
 
 // Return the bit field(s) from the most significant bit (msbit) to the





More information about the lldb-commits mailing list