[Lldb-commits] [PATCH] D80990: [lldb] Fix sizeof() in Scalar::operator=()

Albert Miko via Phabricator via lldb-commits lldb-commits at lists.llvm.org
Tue Jun 2 04:24:57 PDT 2020


miko created this revision.
Herald added a project: LLDB.
Herald added a subscriber: lldb-commits.

In Scalar::operator=(long long) the size of the result was calculated using sizeof(long) instead of sizeof(long long). On Windows sizeof(long)==4 but sizeof(long long)==8.


Repository:
  rG LLVM Github Monorepo

https://reviews.llvm.org/D80990

Files:
  lldb/source/Utility/Scalar.cpp


Index: lldb/source/Utility/Scalar.cpp
===================================================================
--- lldb/source/Utility/Scalar.cpp
+++ lldb/source/Utility/Scalar.cpp
@@ -331,7 +331,7 @@
 
 Scalar &Scalar::operator=(long long v) {
   m_type = e_slonglong;
-  m_integer = llvm::APInt(sizeof(long) * 8, v, true);
+  m_integer = llvm::APInt(sizeof(long long) * 8, v, true);
   return *this;
 }
 


-------------- next part --------------
A non-text attachment was scrubbed...
Name: D80990.267837.patch
Type: text/x-patch
Size: 402 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/lldb-commits/attachments/20200602/518c8663/attachment.bin>


More information about the lldb-commits mailing list