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