Github User Fetcher 1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duk_error_longjmp.c File Reference
#include "duk_internal.h"

Go to the source code of this file.

Functions

DUK_INTERNAL void duk_err_longjmp (duk_hthread *thr)
 

Function Documentation

◆ duk_err_longjmp()

DUK_INTERNAL void duk_err_longjmp ( duk_hthread * thr)

Definition at line 8 of file duktape-1.5.2/src-separate/duk_error_longjmp.c.

8 {
9 DUK_ASSERT(thr != NULL);
10
11 DUK_DD(DUK_DDPRINT("longjmp error: type=%d iserror=%d value1=%!T value2=%!T",
12 (int) thr->heap->lj.type, (int) thr->heap->lj.iserror,
13 &thr->heap->lj.value1, &thr->heap->lj.value2));
14
15#if !defined(DUK_USE_CPP_EXCEPTIONS)
16 /* If we don't have a jmpbuf_ptr, there is little we can do
17 * except panic. The caller's expectation is that we never
18 * return.
19 *
20 * With C++ exceptions we now just propagate an uncaught error
21 * instead of invoking the fatal error handler. Because there's
22 * a dummy jmpbuf for C++ exceptions now, this could be changed.
23 */
24 if (!thr->heap->lj.jmpbuf_ptr) {
25
26 DUK_D(DUK_DPRINT("uncaught error: type=%d iserror=%d value1=%!T value2=%!T",
27 (int) thr->heap->lj.type, (int) thr->heap->lj.iserror,
28 &thr->heap->lj.value1, &thr->heap->lj.value2));
29
30 duk_fatal((duk_context *) thr, DUK_ERR_UNCAUGHT_ERROR, "uncaught error");
32 }
33#endif /* DUK_USE_CPP_EXCEPTIONS */
34
35#if defined(DUK_USE_CPP_EXCEPTIONS)
36 {
37 duk_internal_exception exc; /* dummy */
38 throw exc;
39 }
40#else /* DUK_USE_CPP_EXCEPTIONS */
42#endif /* DUK_USE_CPP_EXCEPTIONS */
43
45}
DUK_EXTERNAL void duk_fatal(duk_context *ctx, duk_errcode_t err_code, const char *err_msg)
#define DUK_ERR_UNCAUGHT_ERROR
#define NULL
Definition gmacros.h:924

References DUK_ASSERT, DUK_D, DUK_DD, DUK_DDPRINT, DUK_DPRINT, DUK_ERR_UNCAUGHT_ERROR, duk_fatal(), DUK_LONGJMP, DUK_UNREACHABLE, duk_hthread::heap, duk_ljstate::iserror, duk_jmpbuf::jb, duk_ljstate::jmpbuf_ptr, duk_heap::lj, NULL, duk_ljstate::type, duk_ljstate::value1, and duk_ljstate::value2.