Fix use after free and calls to operator comma in debug mode

llvm-svn: 232703
Cr-Mirrored-From: sso://chromium.googlesource.com/_direct/external/github.com/llvm/llvm-project
Cr-Mirrored-Commit: 61bff6192613038f721dccf52b0627b58354f9b0
diff --git a/src/debug.cpp b/src/debug.cpp
index 60694a3..b1a16e6 100644
--- a/src/debug.cpp
+++ b/src/debug.cpp
@@ -214,10 +214,10 @@
             else
                 q->__next_ = p->__next_;
             __c_node* c = p->__c_;
-            free(p);
             --__isz_;
             if (c != nullptr)
                 c->__remove(p);
+            free(p);
         }
     }
 }