summaryrefslogtreecommitdiffstats
path: root/lib/command_lex.l
diff options
context:
space:
mode:
authorDavid Lamparter <equinox@opensourcerouting.org>2017-01-24 02:51:00 +0100
committerDavid Lamparter <equinox@opensourcerouting.org>2017-01-24 02:52:07 +0100
commit14152706b42699d5665cd5291637730841e41b94 (patch)
tree915927e3d894e5d5d4b50523b63b2308727e2f00 /lib/command_lex.l
parentbuild: support bison < 3.0 for parse.error=verbose (diff)
downloadfrr-14152706b42699d5665cd5291637730841e41b94.tar.xz
frr-14152706b42699d5665cd5291637730841e41b94.zip
lib: parser: guard yylloc
yylloc seems to be NULL on parser init for some flex+bison combinations... Signed-off-by: David Lamparter <equinox@opensourcerouting.org>
Diffstat (limited to 'lib/command_lex.l')
-rw-r--r--lib/command_lex.l5
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/command_lex.l b/lib/command_lex.l
index 703596b43..2a241abbe 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\*]*