mirror of
https://github.com/QB64Official/qb64.git
synced 2024-07-05 00:40:26 +00:00
Prevents users from creating self-referencing TYPE
blocks.
This commit is contained in:
parent
da76d340c9
commit
05fb2d44a2
|
@ -1953,6 +1953,7 @@ DO
|
|||
IF ii >= n OR getelement$(a$, ii) <> "AS" THEN a$ = "Expected element-name AS type, AS type element-list, or END TYPE": GOTO errmes
|
||||
t$ = getelements$(a$, ii + 1, n)
|
||||
|
||||
IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
|
||||
typ = typname2typ(t$)
|
||||
IF Error_Happened THEN GOTO errmes
|
||||
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
||||
|
@ -2043,6 +2044,7 @@ DO
|
|||
END IF
|
||||
|
||||
t$ = RTRIM$(t$)
|
||||
IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
|
||||
typ = typname2typ(t$)
|
||||
IF Error_Happened THEN GOTO errmes
|
||||
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
||||
|
|
Loading…
Reference in a new issue