summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBoris Kolpackov <boris@codesynthesis.com>2018-05-23 10:46:35 +0200
committerBoris Kolpackov <boris@codesynthesis.com>2018-05-23 10:46:35 +0200
commit038b1acfabf6541b3ea0327d928451bec4aff844 (patch)
tree32c325196396fc898b06a68b2e12160c77efe539
parenta34d2bb1f5f3fc5c533b8440ac78fdd0a55775ea (diff)
Fix ubsan errors
-rw-r--r--cli/token.ixx21
1 files 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)
{
}