| 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; |
no test coverage detected