diff libinterp/parse-tree/token.cc @ 20065:77f65eabac20 stable

avoid crash when __FILE__ is used at top level (bug #44363) * lex.ll (octave_base_lexer::is_keyword_token): Call correct constructor for magic_file_kw. * token.h, token.cc (token::token (int, const char *, int, int)): New constructor.
author John W. Eaton <jwe@octave.org>
date Wed, 25 Feb 2015 11:33:39 -0500
parents d63878346099
children 734a77207e2e
line wrap: on
line diff
--- a/libinterp/parse-tree/token.cc
+++ b/libinterp/parse-tree/token.cc
@@ -52,6 +52,17 @@
   type_tag = is_kw ? keyword_token : generic_token;
 }
 
+token::token (int tv, const char *s, int l, int c)
+{
+  maybe_cmd = false;
+  tspc = false;
+  line_num = l;
+  column_num = c;
+  tok_val = tv;
+  type_tag = string_token;
+  str = new std::string (s);
+}
+
 token::token (int tv, const std::string& s, int l, int c)
 {
   maybe_cmd = false;