[Lldb-commits] [lldb] aa1943a - Don't take the address of a temporary

Adrian Prantl via lldb-commits lldb-commits at lists.llvm.org
Fri Jan 8 13:24:41 PST 2021


Author: Adrian Prantl
Date: 2021-01-08T13:24:07-08:00
New Revision: aa1943a2d167823e6d506895292477f79874dd20

URL: https://github.com/llvm/llvm-project/commit/aa1943a2d167823e6d506895292477f79874dd20
DIFF: https://github.com/llvm/llvm-project/commit/aa1943a2d167823e6d506895292477f79874dd20.diff

LOG: Don't take the address of a temporary

Added: 
    

Modified: 
    lldb/source/Core/ValueObject.cpp

Removed: 
    


################################################################################
diff  --git a/lldb/source/Core/ValueObject.cpp b/lldb/source/Core/ValueObject.cpp
index bcd76f5a74be4..da90092336d69 100644
--- a/lldb/source/Core/ValueObject.cpp
+++ b/lldb/source/Core/ValueObject.cpp
@@ -3205,7 +3205,7 @@ bool ValueObject::CanProvideValue() {
   // we need to support invalid types as providers of values because some bare-
   // board debugging scenarios have no notion of types, but still manage to
   // have raw numeric values for things like registers. sigh.
-  const CompilerType &type(GetCompilerType());
+  CompilerType type = GetCompilerType();
   return (!type.IsValid()) || (0 != (type.GetTypeInfo() & eTypeHasValue));
 }
 


        


More information about the lldb-commits mailing list