aboutsummaryrefslogtreecommitdiff
path: root/gcc
diff options
context:
space:
mode:
authorPierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>2023-08-29 17:24:03 +0200
committerArthur Cohen <arthur.cohen@embecosm.com>2024-01-16 19:04:34 +0100
commit1501eed45018df1365c7d2a06772ca82dca1b8fe (patch)
tree40eae1808b1f0350e3a7c66dcdf3273c6945b2f8 /gcc
parente6cd1103050c48242923ae6f862437110331beb9 (diff)
downloadgcc-1501eed45018df1365c7d2a06772ca82dca1b8fe.zip
gcc-1501eed45018df1365c7d2a06772ca82dca1b8fe.tar.gz
gcc-1501eed45018df1365c7d2a06772ca82dca1b8fe.tar.bz2
gccrs: Add missing linemap to lexer
When some proc macro create tokens and later have some code referring to those created tokens the code was missing a linemap since the pointer was null, throwing an ICE. gcc/rust/ChangeLog: * expand/rust-proc-macro.cc (tokenstream_from_string): Change linemap null pointer to the current linemap. Signed-off-by: Pierre-Emmanuel Patry <pierre-emmanuel.patry@embecosm.com>
Diffstat (limited to 'gcc')
-rw-r--r--gcc/rust/expand/rust-proc-macro.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gcc/rust/expand/rust-proc-macro.cc b/gcc/rust/expand/rust-proc-macro.cc
index f0f6d65..2fdfcb2 100644
--- a/gcc/rust/expand/rust-proc-macro.cc
+++ b/gcc/rust/expand/rust-proc-macro.cc
@@ -16,6 +16,7 @@
#include "rust-diagnostics.h"
#include "rust-proc-macro.h"
+#include "rust-session-manager.h"
#include "rust-lex.h"
#include "rust-token-converter.h"
#include "rust-attributes.h"
@@ -68,7 +69,7 @@ ProcMacro::TokenStream
tokenstream_from_string (std::string &data, bool &lex_error)
{
// FIXME: Insert location pointing to call site in tokens
- Lexer lex (data, nullptr);
+ Lexer lex (data, Session::get_instance ().linemap);
std::vector<const_TokenPtr> tokens;
TokenPtr ptr;