Explorar o código

HPCC-20627 New defects reported by Coverity Scan

Fix some (harmless) Coverity warnings.

Signed-off-by: Richard Chapman <rchapman@hpccsystems.com>
Richard Chapman %!s(int64=6) %!d(string=hai) anos
pai
achega
f4d12e42b9
Modificáronse 2 ficheiros con 5 adicións e 2 borrados
  1. 2 1
      common/deftype/deffield.cpp
  2. 3 1
      common/deftype/deftype.cpp

+ 2 - 1
common/deftype/deffield.cpp

@@ -259,7 +259,8 @@ static void addElementToPTree(IPropertyTree * root, IDefRecordElement * elem)
     {
     case DEKnone:
         branchName.set("None");
-        assertex(elem->numChildren() == 0);
+        if (elem)
+            assertex(elem->numChildren() == 0);
         break;
     case DEKrecord:
         {

+ 3 - 1
common/deftype/deftype.cpp

@@ -1223,6 +1223,7 @@ bool CTransformTypeInfo::assignableFrom(ITypeInfo *t2)
 bool CSortListTypeInfo::assignableFrom(ITypeInfo *t2)
 {
     return (getTypeCode()==t2->getTypeCode());
+/*
     {
         //Not convinced any of this should be here...
         ITypeInfo *c1 = queryChildType();
@@ -1236,6 +1237,7 @@ bool CSortListTypeInfo::assignableFrom(ITypeInfo *t2)
         return false;
     }
     return queryChildType()->assignableFrom(t2);
+*/
 }
 
 bool CRowTypeInfo::assignableFrom(ITypeInfo *t2)
@@ -1881,7 +1883,6 @@ extern DEFTYPE_API ITypeInfo *makeGroupedTableType(ITypeInfo *basetype)
 
 extern DEFTYPE_API ITypeInfo *makeFunctionType(ITypeInfo *basetype, IInterface * parameters, IInterface * defaults, IInterface * attrs)
 {
-    assertex(basetype->getTypeCode() != type_function); // not just yet anyway
     if (!basetype || !parameters)
     {
         ::Release(basetype);
@@ -1890,6 +1891,7 @@ extern DEFTYPE_API ITypeInfo *makeFunctionType(ITypeInfo *basetype, IInterface *
         ::Release(attrs);
         throwUnexpected();
     }
+    assertex(basetype->getTypeCode() != type_function); // not just yet anyway
     return commonUpType(new CFunctionTypeInfo(basetype, parameters, defaults, attrs));
 }