Github User Fetcher
1.0.0
C Application with Server and GUI
Loading...
Searching...
No Matches
duktape-1.5.2/src-separate/duk_error_longjmp.c
Go to the documentation of this file.
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
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"
);
31
DUK_UNREACHABLE
();
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 */
41
DUK_LONGJMP
(thr->
heap
->
lj
.
jmpbuf_ptr
->
jb
);
42
#endif
/* DUK_USE_CPP_EXCEPTIONS */
43
44
DUK_UNREACHABLE
();
45
}
DUK_UNREACHABLE
#define DUK_UNREACHABLE()
Definition
duktape-1.5.2/src-noline/duk_config.h:2504
DUK_INTERNAL
#define DUK_INTERNAL
Definition
duktape-1.5.2/src-noline/duk_config.h:2548
DUK_LONGJMP
#define DUK_LONGJMP(jb)
Definition
duktape-1.5.2/src-noline/duk_config.h:1918
DUK_DPRINT
#define DUK_DPRINT
Definition
duktape-1.5.2/src-noline/duktape.c:7507
DUK_ASSERT
#define DUK_ASSERT(x)
Definition
duktape-1.5.2/src-noline/duktape.c:7755
DUK_DD
#define DUK_DD(x)
Definition
duktape-1.5.2/src-noline/duktape.c:7496
DUK_D
#define DUK_D(x)
Definition
duktape-1.5.2/src-noline/duktape.c:7495
DUK_DDPRINT
#define DUK_DDPRINT
Definition
duktape-1.5.2/src-noline/duktape.c:7508
duk_fatal
DUK_EXTERNAL void duk_fatal(duk_context *ctx, duk_errcode_t err_code, const char *err_msg)
Definition
duktape-1.5.2/src-noline/duktape.c:19220
DUK_ERR_UNCAUGHT_ERROR
#define DUK_ERR_UNCAUGHT_ERROR
Definition
duktape-1.5.2/src-noline/duktape.h:337
duk_err_longjmp
DUK_INTERNAL void duk_err_longjmp(duk_hthread *thr)
Definition
duktape-1.5.2/src-separate/duk_error_longjmp.c:8
duk_internal.h
NULL
#define NULL
Definition
gmacros.h:924
duk_heap::lj
duk_ljstate lj
Definition
duktape-1.5.2/src-noline/duktape.c:7035
duk_hthread
Definition
duktape-1.5.2/src-noline/duktape.c:6190
duk_hthread::heap
duk_heap * heap
Definition
duktape-1.5.2/src-noline/duktape.c:6202
duk_jmpbuf::jb
DUK_JMPBUF_TYPE jb
Definition
duktape-1.5.2/src-noline/duktape.c:206
duk_ljstate::jmpbuf_ptr
duk_jmpbuf * jmpbuf_ptr
Definition
duktape-1.5.2/src-noline/duktape.c:6948
duk_ljstate::type
duk_small_uint_t type
Definition
duktape-1.5.2/src-noline/duktape.c:6949
duk_ljstate::iserror
duk_bool_t iserror
Definition
duktape-1.5.2/src-noline/duktape.c:6950
duk_ljstate::value2
duk_tval value2
Definition
duktape-1.5.2/src-noline/duktape.c:6952
duk_ljstate::value1
duk_tval value1
Definition
duktape-1.5.2/src-noline/duktape.c:6951
vendor
civetweb
third_party
duktape-1.5.2
src-separate
duk_error_longjmp.c
Generated by
1.10.0