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

Method runWithCatch

src/simulate/simulate_exceptions.cpp:127–163  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

125 }
126
127 bool WIN_EH_NO_ASAN Context::runWithCatch ( const callable<void()> & subexpr ) {
128 auto aa = abiArg;
129 auto acm = abiCMRES;
130 auto atba = abiThisBlockArg;
131 char * EP, * SP;
132 stack.watermark(EP,SP);
133 bool bres = false;
134#if DAS_ENABLE_EXCEPTIONS
135 try {
136 subexpr();
137 bres = true;
138 } catch ( const dasException & ex ) {
139 abiArg = aa;
140 abiCMRES = acm;
141 abiThisBlockArg = atba;
142 stack.pop(EP,SP);
143 exceptionMessage = ex.what();
144 exception = exceptionMessage.c_str();
145 exceptionAt = ex.exceptionAt;
146 }
147#else
148 jmp_buf ev;
149 jmp_buf * JB = throwBuf;
150 throwBuf = &ev;
151 if ( !setjmp(ev) ) {
152 subexpr();
153 bres = true;
154 } else {
155 abiArg = aa;
156 abiCMRES = acm;
157 abiThisBlockArg = atba;
158 stack.pop(EP,SP);
159 }
160 throwBuf = JB;
161#endif
162 return bres;
163 }
164
165 void Context::clearException() {
166 stopFlags = 0;

Callers 9

scalar_trampolineFunction · 0.80
data_callbackFunction · 0.80
simulateMethod · 0.80
runMacroFunctionFunction · 0.80
pinvoke_implFunction · 0.80
pinvoke_impl2_coreFunction · 0.80
pinvoke_impl3Function · 0.80

Calls 4

watermarkMethod · 0.80
popMethod · 0.45
whatMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected