MCPcopy Create free account
hub / github.com/GaijinEntertainment/daScript / evalWithCatch

Method evalWithCatch

src/simulate/simulate_exceptions.cpp:91–125  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

89 }
90
91 vec4f WIN_EH_NO_ASAN Context::evalWithCatch ( SimNode * node ) {
92 auto aa = abiArg;
93 auto acm = abiCMRES;
94 auto atba = abiThisBlockArg;
95 char * EP, * SP;
96 stack.watermark(EP,SP);
97 vec4f vres = v_zero();
98#if DAS_ENABLE_EXCEPTIONS
99 try {
100 vres = node->eval(*this);
101 } catch ( const dasException & ex ) {
102 abiArg = aa;
103 abiCMRES = acm;
104 abiThisBlockArg = atba;
105 stack.pop(EP,SP);
106 exceptionMessage = ex.what();
107 exception = exceptionMessage.c_str();
108 exceptionAt = ex.exceptionAt;
109 }
110#else
111 jmp_buf ev;
112 jmp_buf * JB = throwBuf;
113 throwBuf = &ev;
114 if ( !setjmp(ev) ) {
115 vres = node->eval(*this);
116 } else {
117 abiArg = aa;
118 abiCMRES = acm;
119 abiThisBlockArg = atba;
120 stack.pop(EP,SP);
121 }
122 throwBuf = JB;
123#endif
124 return vres;
125 }
126
127 bool WIN_EH_NO_ASAN Context::runWithCatch ( const callable<void()> & subexpr ) {
128 auto aa = abiArg;

Callers 15

aot_compileFunction · 0.80
compile_and_runFunction · 0.80
call_annotated_listFunction · 0.80
run_lifecycleFunction · 0.80
init_dyn_modulesFunction · 0.80
evalMethod · 0.80
evalSingleExpressionFunction · 0.80

Calls 7

callWithCopyOnReturnFunction · 0.85
watermarkMethod · 0.80
v_zeroFunction · 0.50
evalMethod · 0.45
popMethod · 0.45
whatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected