OSDN Git Service

Don't take the address of a temporary
authorAdrian Prantl <aprantl@apple.com>
Fri, 8 Jan 2021 21:14:52 +0000 (13:14 -0800)
committerAdrian Prantl <aprantl@apple.com>
Fri, 8 Jan 2021 21:24:07 +0000 (13:24 -0800)
lldb/source/Core/ValueObject.cpp

index bcd76f5..da90092 100644 (file)
@@ -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));
 }