Explorar o código

Fix for prefast warning

Meghana Gupta %!s(int64=8) %!d(string=hai) anos
pai
achega
ef2d1e05ab
Modificáronse 1 ficheiros con 2 adicións e 1 borrados
  1. 2 1
      lib/Backend/Region.cpp

+ 2 - 1
lib/Backend/Region.cpp

@@ -87,7 +87,8 @@ Region::GetFirstAncestorOfNonExceptingFinallyParent()
     }
 
     Assert(ancestor);
-    return ancestor->GetType() == RegionTypeRoot ? ancestor : ancestor->GetParent();
+    // Null check added to avoid prefast warning only
+    return ancestor ? (ancestor->GetType() == RegionTypeRoot ? ancestor : ancestor->GetParent()) : nullptr;
 }
 
 // Return first ancestor which is not a non exception finally