MCPcopy Create free account
hub / github.com/AutoHotkey/AutoHotkey / CheckValidFinallyJump

Method CheckValidFinallyJump

source/script2.cpp:9156–9171  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9154
9155
9156BOOL 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////////////////////////

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected