From 038b1acfabf6541b3ea0327d928451bec4aff844 Mon Sep 17 00:00:00 2001 From: Boris Kolpackov Date: Wed, 23 May 2018 10:46:35 +0200 Subject: Fix ubsan errors --- cli/token.ixx | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/cli/token.ixx b/cli/token.ixx index 8729b4c..e2360ce 100644 --- a/cli/token.ixx +++ b/cli/token.ixx @@ -53,24 +53,37 @@ expression () const inline token:: token (std::size_t l, std::size_t c) - : l_ (l), c_ (c), type_ (t_eos) + : l_ (l), c_ (c), + type_ (t_eos), + keyword_ (k_invalid), + punctuation_ (p_invalid) { } inline token:: token (keyword_type k, std::size_t l, std::size_t c) - : l_ (l), c_ (c), type_ (t_keyword), keyword_ (k) + : l_ (l), c_ (c), + type_ (t_keyword), + keyword_ (k), + punctuation_ (p_invalid) { } inline token:: token (punctuation_type p, std::size_t l, std::size_t c) - : l_ (l), c_ (c), type_ (t_punctuation), punctuation_ (p) + : l_ (l), c_ (c), + type_ (t_punctuation), + keyword_ (k_invalid), + punctuation_ (p) { } inline token:: token (token_type t, std::string const& s, std::size_t l, std::size_t c) - : l_ (l), c_ (c), type_ (t), str_ (s) + : l_ (l), c_ (c), + type_ (t), + keyword_ (k_invalid), + punctuation_ (p_invalid), + str_ (s) { } -- cgit v1.1