]> git.proxmox.com Git - ceph.git/blob - ceph/src/civetweb/src/third_party/duktape-1.3.0/src-separate/duk_error_longjmp.c
add subtree-ish sources for 12.0.3
[ceph.git] / ceph / src / civetweb / src / third_party / duktape-1.3.0 / src-separate / duk_error_longjmp.c
1 /*
2 * Do a longjmp call, calling the fatal error handler if no
3 * catchpoint exists.
4 */
5
6 #include "duk_internal.h"
7
8 DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr) {
9 DUK_ASSERT(thr != NULL);
10
11 if (!thr->heap->lj.jmpbuf_ptr) {
12 /*
13 * If we don't have a jmpbuf_ptr, there is little we can do
14 * except panic. The caller's expectation is that we never
15 * return.
16 */
17
18 DUK_D(DUK_DPRINT("uncaught error: type=%d iserror=%d value1=%!T value2=%!T",
19 (int) thr->heap->lj.type, (int) thr->heap->lj.iserror,
20 &thr->heap->lj.value1, &thr->heap->lj.value2));
21
22 duk_fatal((duk_context *) thr, DUK_ERR_UNCAUGHT_ERROR, "uncaught error");
23 DUK_UNREACHABLE();
24 }
25
26 DUK_LONGJMP(thr->heap->lj.jmpbuf_ptr->jb);
27 DUK_UNREACHABLE();
28 }