From 14152706b42699d5665cd5291637730841e41b94 Mon Sep 17 00:00:00 2001 From: David Lamparter Date: Tue, 24 Jan 2017 02:51:00 +0100 Subject: [PATCH] lib: parser: guard yylloc yylloc seems to be NULL on parser init for some flex+bison combinations... Signed-off-by: David Lamparter --- lib/command_lex.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lib/command_lex.l b/lib/command_lex.l index 703596b43d..2a241abbec 100644 --- a/lib/command_lex.l +++ b/lib/command_lex.l @@ -26,9 +26,10 @@ #include "command_parse.h" #define YY_USER_ACTION yylloc->last_column += yyleng; -#define LOC_STEP \ +#define LOC_STEP do { if (yylloc) { \ yylloc->first_column = yylloc->last_column; \ - yylloc->first_line = yylloc->last_line; + yylloc->first_line = yylloc->last_line; \ + } } while(0) %} WORD (\-|\+)?[a-z0-9\*][-+_a-zA-Z0-9\*]* -- 2.39.5