[Lldb-commits] [lldb] r255499 - Add failure paths to a few JSONNumber members
Omair Javaid via lldb-commits
lldb-commits at lists.llvm.org
Mon Dec 14 06:52:08 PST 2015
Author: omjavaid
Date: Mon Dec 14 08:52:07 2015
New Revision: 255499
URL: http://llvm.org/viewvc/llvm-project?rev=255499&view=rev
Log:
Add failure paths to a few JSONNumber members
Differential revision: http://reviews.llvm.org/D15355
Modified:
lldb/trunk/include/lldb/Utility/JSON.h
lldb/trunk/source/Utility/JSON.cpp
Modified: lldb/trunk/include/lldb/Utility/JSON.h
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/include/lldb/Utility/JSON.h?rev=255499&r1=255498&r2=255499&view=diff
==============================================================================
--- lldb/trunk/include/lldb/Utility/JSON.h (original)
+++ lldb/trunk/include/lldb/Utility/JSON.h Mon Dec 14 08:52:07 2015
@@ -145,7 +145,7 @@ namespace lldb_private {
uint64_t
GetAsUnsigned() const;
- uint64_t
+ int64_t
GetAsSigned() const;
double
Modified: lldb/trunk/source/Utility/JSON.cpp
URL: http://llvm.org/viewvc/llvm-project/lldb/trunk/source/Utility/JSON.cpp?rev=255499&r1=255498&r2=255499&view=diff
==============================================================================
--- lldb/trunk/source/Utility/JSON.cpp (original)
+++ lldb/trunk/source/Utility/JSON.cpp Mon Dec 14 08:52:07 2015
@@ -12,6 +12,7 @@
#include <limits.h>
#include "lldb/Core/StreamString.h"
#include "lldb/Host/StringConvert.h"
+#include "llvm/Support/ErrorHandling.h"
using namespace lldb_private;
@@ -72,9 +73,10 @@ JSONNumber::GetAsUnsigned() const
case DataType::Double:
return (uint64_t)m_data.m_double;
}
+ llvm_unreachable("Unhandled data type");
}
-uint64_t
+int64_t
JSONNumber::GetAsSigned() const
{
switch (m_data_type)
@@ -86,6 +88,7 @@ JSONNumber::GetAsSigned() const
case DataType::Double:
return (int64_t)m_data.m_double;
}
+ llvm_unreachable("Unhandled data type");
}
double
@@ -100,6 +103,7 @@ JSONNumber::GetAsDouble() const
case DataType::Double:
return m_data.m_double;
}
+ llvm_unreachable("Unhandled data type");
}
void
More information about the lldb-commits
mailing list