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
|
703
|
|
|
|
|
|
template static inline auto throw_guard (pTHX_ CV* context, F&& f) -> decltype(f()) { |
16
|
|
|
|
|
|
|
SV* exc; |
17
|
703
|
50
|
|
|
|
|
try { return f(); } |
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
|
|
|
|
|
|
|
|
0
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