Lua exception handling test
authorDan Melnic <dmm@fb.com>
Tue, 18 Jul 2017 01:50:41 +0000 (18:50 -0700)
committerFacebook Github Bot <facebook-github-bot@users.noreply.github.com>
Tue, 18 Jul 2017 01:53:05 +0000 (18:53 -0700)
Summary: Lua exception handling test - start with the failing test first - code from D5431445

Reviewed By: yfeldblum

Differential Revision: D5432254

fbshipit-source-id: 87f5934f28ac6ef7b55314acb3c150b9ccf6c799

folly/experimental/exception_tracer/ExceptionStackTraceLib.cpp

index 167cd400b8e33a45898b435ccb5af744d66cdf71..57f0fd688648664576c2aaf76e3724c4b98a7bcb 100644 (file)
@@ -88,7 +88,8 @@ struct Initializer {
       // exceptions.
       // In the rethrow case, we've already popped the exception off the
       // caught stack, so we don't do anything here.
-      if (top->handlerCount == 1) {
+      // For Lua interop, we see the handlerCount = 0
+      if ((top->handlerCount == 1) || (top->handlerCount == 0)) {
         if (!caughtExceptions.pop()) {
           activeExceptions.clear();
           invalid = true;