summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-23 10:49:42 +0100
committerDaniel Kolesa <d.kolesa@osg.samsung.com>2016-05-23 10:49:42 +0100
commit4bdb1f73b8ec55d4d00a2ce6607d47f388150ed2 (patch)
treed1a2e081f341aa725152f4a61d1b70d6d30b0344
parent83a2ed5e700a2e44eb2a469fcb33075cfc0b114b (diff)
eolian: handle invalid keywords correctly
Before this Eolian segfaulted when an invalid keyword was used. Fixes T3672.
-rw-r--r--src/lib/eolian/eo_lexer.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/lib/eolian/eo_lexer.c b/src/lib/eolian/eo_lexer.c
index dff540c81b..c38eb49d4a 100644
--- a/src/lib/eolian/eo_lexer.c
+++ b/src/lib/eolian/eo_lexer.c
@@ -954,9 +954,9 @@ lex(Eo_Lexer *ls, Eo_Token *tok)
954 tok->kw = (int)(uintptr_t)eina_hash_find(keyword_map, 954 tok->kw = (int)(uintptr_t)eina_hash_find(keyword_map,
955 str); 955 str);
956 ls->column = col + 1; 956 ls->column = col + 1;
957 tok->value.s = eina_stringshare_add(str);
957 if (at_kw && tok->kw == 0) 958 if (at_kw && tok->kw == 0)
958 eo_lexer_syntax_error(ls, "invalid keyword"); 959 eo_lexer_syntax_error(ls, "invalid keyword");
959 tok->value.s = eina_stringshare_add(str);
960 return TOK_VALUE; 960 return TOK_VALUE;
961 } 961 }
962 else 962 else