| 9154 | |
| 9155 | |
| 9156 | BOOL Line::CheckValidFinallyJump(Line* jumpTarget, bool aSilent) |
| 9157 | { |
| 9158 | Line* jumpParent = jumpTarget->mParentLine; |
| 9159 | for (Line *ancestor = mParentLine; ancestor != NULL; ancestor = ancestor->mParentLine) |
| 9160 | { |
| 9161 | if (ancestor == jumpParent) |
| 9162 | return TRUE; // We found the common ancestor. |
| 9163 | if (ancestor->mActionType == ACT_FINALLY) |
| 9164 | { |
| 9165 | if (!aSilent) |
| 9166 | LineError(ERR_BAD_JUMP_INSIDE_FINALLY); |
| 9167 | return FALSE; // The common ancestor is outside the FINALLY block and thus this jump is invalid. |
| 9168 | } |
| 9169 | } |
| 9170 | return TRUE; // The common ancestor is the root of the script. |
| 9171 | } |
| 9172 | |
| 9173 | |
| 9174 | //////////////////////// |
nothing calls this directly
no outgoing calls
no test coverage detected