[libcxx-commits] [PATCH] D124255: [libc++] Make check_assertion.h use setjmp/longjmp instead of fork

Louis Dionne via Phabricator via libcxx-commits libcxx-commits at lists.llvm.org
Sun Apr 24 10:27:45 PDT 2022


ldionne added a comment.

This looks really interesting! However, doesn't that mean that we can't assert that the process terminates if a certain condition is met?



================
Comment at: libcxx/test/support/check_assertion.h:148
+    if (IsValidResultKind(n))
+      return (ResultKind)n;
     return RK_Unknown;
----------------



================
Comment at: libcxx/test/support/check_assertion.h:162
   if (GlobalMatcher().Matches(file, line, message)) {
-    std::exit(DeathTest::RK_MatchFound);
+    longjmp(GetJmpBuf(), DeathTest::RK_MatchFound);
   }
----------------
Here and elsewhere.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D124255/new/

https://reviews.llvm.org/D124255



More information about the libcxx-commits mailing list