aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGiuliano Procida <gprocida@google.com>2024-01-19 09:03:43 +0000
committerGiuliano Procida <gprocida@google.com>2024-02-09 12:54:51 +0000
commitb848ace10cfa7a6b7c18bd5cc25af53cc328e840 (patch)
treeca0897b8acc13b37c6add860a65a6a87837f94ea
parent6897a936c471667bbaca7fb717d4cdd8fecee66f (diff)
downloadstg-b848ace10cfa7a6b7c18bd5cc25af53cc328e840.tar.gz
Abigailed reader: compare against nullptr in a couple of places
This is a bit clearer than just testing the pointer. PiperOrigin-RevId: 599756047 Change-Id: I899669bef0bfa808bec857bab01643656174f0a4
-rw-r--r--abigail_reader.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/abigail_reader.cc b/abigail_reader.cc
index 835d75e..cdfc1c6 100644
--- a/abigail_reader.cc
+++ b/abigail_reader.cc
@@ -1157,7 +1157,7 @@ void Abigail::ProcessEnum(Id id, xmlNodePtr enumeration) {
}
xmlNodePtr underlying = Child(enumeration);
- Check(underlying) << "enum-decl has no child elements";
+ Check(underlying != nullptr) << "enum-decl has no child elements";
CheckName("underlying-type", underlying);
const auto type = GetEdge(underlying);
@@ -1306,7 +1306,7 @@ Document Read(const std::string& path, Metrics& metrics) {
Id Read(Graph& graph, const std::string& path, Metrics& metrics) {
const Document document = Read(path, metrics);
xmlNodePtr root = xmlDocGetRootElement(document.get());
- Check(root) << "XML document has no root element";
+ Check(root != nullptr) << "XML document has no root element";
return Abigail(graph).ProcessRoot(root);
}