eolian: handle invalid keywords correctly
Before this Eolian segfaulted when an invalid keyword was used. Fixes T3672.
This commit is contained in:
parent
83a2ed5e70
commit
4bdb1f73b8
|
@ -954,9 +954,9 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
|
||||||
tok->kw = (int)(uintptr_t)eina_hash_find(keyword_map,
|
tok->kw = (int)(uintptr_t)eina_hash_find(keyword_map,
|
||||||
str);
|
str);
|
||||||
ls->column = col + 1;
|
ls->column = col + 1;
|
||||||
|
tok->value.s = eina_stringshare_add(str);
|
||||||
if (at_kw && tok->kw == 0)
|
if (at_kw && tok->kw == 0)
|
||||||
eo_lexer_syntax_error(ls, "invalid keyword");
|
eo_lexer_syntax_error(ls, "invalid keyword");
|
||||||
tok->value.s = eina_stringshare_add(str);
|
|
||||||
return TOK_VALUE;
|
return TOK_VALUE;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
Loading…
Reference in New Issue