summaryrefslogtreecommitdiffstats
path: root/dimension/lexer.l
diff options
context:
space:
mode:
Diffstat (limited to 'dimension/lexer.l')
-rw-r--r--dimension/lexer.l13
1 files changed, 8 insertions, 5 deletions
diff --git a/dimension/lexer.l b/dimension/lexer.l
index 05c6711..5027d71 100644
--- a/dimension/lexer.l
+++ b/dimension/lexer.l
@@ -71,11 +71,14 @@
RETURN(); \
} while (0)
-#define RETURN_VALUE_TOKEN(token_type) \
- do { \
- NEW_TOKEN(token_type); \
- lvalp->value = strdup(yytext); \
- RETURN(); \
+#define RETURN_VALUE_TOKEN(token_type) \
+ do { \
+ NEW_TOKEN(token_type); \
+ lvalp->value = strdup(yytext); \
+ if (!lvalp->value) \
+ dmnsn_error(DMNSN_SEVERITY_HIGH, \
+ "Couldn't allocate space for token value."); \
+ RETURN(); \
} while (0)
#define STRING_TOKEN() \