| 9095 | |
| 9096 | |
| 9097 | Label *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 |
no test coverage detected