================
@@ -252,14 +264,19 @@ class Pointer {
 
   /// Checks if the pointer is null.
   bool isZero() const {
-    if (isBlockPointer())
+    switch (StorageKind) {
+    case Storage::Int:
+      return Int.Value == 0 && Offset == 0;
+    case Storage::Block:
       return BS.Pointee == nullptr;
-    if (isFunctionPointer())
-      return Fn.isZero();
-    if (isTypeidPointer())
+    case Storage::Fn:
+      return asFunctionPointer().isZero();
+    case Storage::Typeid:
       return false;
-    assert(isIntegralPointer());
-    return Int.Value == 0 && Offset == 0;
+    case Storage::Degen:
+      return DP.Pointee == nullptr;
+    }
+    llvm_unreachable("huh²");
----------------
shafik wrote:

Can we get a more information message here?

https://github.com/llvm/llvm-project/pull/160086
_______________________________________________
cfe-commits mailing list
[email protected]
https://lists.llvm.org/cgi-bin/mailman/listinfo/cfe-commits

Reply via email to