| 384 | } |
| 385 | |
| 386 | bool checkBranch(Branch& branch) const { |
| 387 | Analyzer::Action a = analyzeScope(branch.endBlock); |
| 388 | branch.action = a; |
| 389 | std::vector<ForwardTraversal> ft1 = tryForkUpdateScope(branch.endBlock, a.isModified()); |
| 390 | const bool bail = hasGoto(branch.endBlock); |
| 391 | if (!a.isModified() && !bail) { |
| 392 | if (ft1.empty()) { |
| 393 | // Traverse into the branch to see if there is a conditional escape |
| 394 | if (!branch.escape && hasInnerReturnScope(branch.endBlock->previous(), branch.endBlock->link())) { |
| 395 | ForwardTraversal ft2 = fork(true); |
| 396 | ft2.updateScope(branch.endBlock); |
| 397 | if (ft2.terminate == Analyzer::Terminate::Escape) { |
| 398 | branch.escape = true; |
| 399 | branch.escapeUnknown = false; |
| 400 | } |
| 401 | } |
| 402 | } else { |
| 403 | if (ft1.front().terminate == Analyzer::Terminate::Escape) { |
| 404 | branch.escape = true; |
| 405 | branch.escapeUnknown = false; |
| 406 | } |
| 407 | } |
| 408 | } |
| 409 | return bail; |
| 410 | } |
| 411 | |
| 412 | bool reentersLoop(Token* endBlock, const Token* condTok, const Token* stepTok) const { |
| 413 | if (!condTok) |
no test coverage detected