line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
1
|
|
|
|
|
|
|
#pragma once |
2
|
|
|
|
|
|
|
#include |
3
|
|
|
|
|
|
|
#include |
4
|
|
|
|
|
|
|
|
5
|
|
|
|
|
|
|
namespace xs { |
6
|
|
|
|
|
|
|
|
7
|
|
|
|
|
|
|
using CatchHandlerSimple = std::function; |
8
|
|
|
|
|
|
|
using CatchHandler = std::function; |
9
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
void add_catch_handler (CatchHandlerSimple f); |
11
|
|
|
|
|
|
|
void add_catch_handler (CatchHandler f); |
12
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Sv _exc2sv (pTHX_ const Sub&); |
14
|
|
|
|
|
|
|
|
15
|
123
|
|
|
|
|
|
template static inline auto throw_guard (pTHX_ CV* context, F&& f) -> decltype(f()) { |
16
|
|
|
|
|
|
|
SV* exc; |
17
|
123
|
50
|
|
|
|
|
try { return f(); } |
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
|
|
100
|
|
|
|
|
|
18
|
6
|
|
|
|
|
|
catch (...) { |
19
|
6
|
0
|
|
|
|
|
auto tmp = xs::_exc2sv(aTHX_ context); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
20
|
3
|
0
|
|
|
|
|
if (tmp) exc = tmp.detach(); |
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
21
|
|
|
|
|
|
|
else exc = newSVpvs(""); |
22
|
|
|
|
|
|
|
} |
23
|
3
|
|
|
|
|
|
croak_sv(sv_2mortal(exc)); |
24
|
|
|
|
|
|
|
} |
25
|
|
|
|
|
|
|
|
26
|
|
|
|
|
|
|
} |