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

Method GetJumpTarget

source/script2.cpp:9097–9113  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

9095
9096
9097Label *Line::GetJumpTarget(bool aIsDereferenced)
9098{
9099 LPTSTR target_label = aIsDereferenced ? ARG1 : RAW_ARG1;
9100 Label *label = g_script.FindLabel(target_label);
9101 if (!label)
9102 {
9103 LineError(ERR_NO_LABEL, FAIL, target_label);
9104 return NULL;
9105 }
9106 // If g->CurrentFunc, label is never outside the function since it would not
9107 // have been found by FindLabel(). So there's no need to check for that here.
9108 if (!aIsDereferenced)
9109 mRelatedLine = (Line *)label; // The script loader has ensured that label->mJumpToLine isn't NULL.
9110 // else don't update it, because that would permanently resolve the jump target, and we want it to stay dynamic.
9111 return IsJumpValid(*label);
9112 // Any error msg was already displayed by the above call.
9113}
9114
9115
9116

Callers 2

PreparseCommandsMethod · 0.80
ExecUntilMethod · 0.80

Calls 1

FindLabelMethod · 0.80

Tested by

no test coverage detected