mirror of
https://github.com/QB64Official/qb64.git
synced 2024-08-22 11:25:08 +00:00
Prevents users from creating self-referencing TYPE
blocks.
This commit is contained in:
parent
da76d340c9
commit
05fb2d44a2
1 changed files with 2 additions and 0 deletions
|
@ -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
|
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)
|
t$ = getelements$(a$, ii + 1, n)
|
||||||
|
|
||||||
|
IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
|
||||||
typ = typname2typ(t$)
|
typ = typname2typ(t$)
|
||||||
IF Error_Happened THEN GOTO errmes
|
IF Error_Happened THEN GOTO errmes
|
||||||
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
||||||
|
@ -2043,6 +2044,7 @@ DO
|
||||||
END IF
|
END IF
|
||||||
|
|
||||||
t$ = RTRIM$(t$)
|
t$ = RTRIM$(t$)
|
||||||
|
IF t$ = RTRIM$(udtxname(definingtype)) THEN a$ = "Invalid self-reference": GOTO errmes
|
||||||
typ = typname2typ(t$)
|
typ = typname2typ(t$)
|
||||||
IF Error_Happened THEN GOTO errmes
|
IF Error_Happened THEN GOTO errmes
|
||||||
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
IF typ = 0 THEN a$ = "Undefined type": GOTO errmes
|
||||||
|
|
Loading…
Reference in a new issue