Using a label inside an expression now raises an error.

[COMPILER]
* BUG: Using a label inside an expression now raises an error.
This commit is contained in:
Benoît Minisini 2023-09-30 14:14:03 +02:00
parent 8ecd7615f8
commit 798d3c36de

View File

@ -278,8 +278,12 @@ static void trans_identifier(int index, bool point, PATTERN next)
_last_symbol_used = NULL;
//fprintf(stderr, "_last_symbol_used = NULL\n");
if (!TYPE_is_null(sym->local.type) && !point)
{
if (TYPE_get_kind(sym->local.type) == TK_LABEL)
goto __CLASS;
if (TYPE_is_static(sym->local.type))
CODE_push_global(sym->local.value, TRUE, FALSE);
else
@ -294,6 +298,7 @@ static void trans_identifier(int index, bool point, PATTERN next)
else if (!TYPE_is_null(sym->global.type) && !point)
{
type = TYPE_get_kind(sym->global.type);
if (!TYPE_is_public(sym->global.type))
{
sym->global_used = TRUE;