Skip to content

Commit

Permalink
fix(cxx_indexer): don't create a temporary and use its address for us…
Browse files Browse the repository at this point in the history
…rs (#5720)
  • Loading branch information
zrlk committed Jun 23, 2023
1 parent 56306f0 commit aefac5c
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions kythe/cxx/indexer/cxx/KytheGraphObserver.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1055,8 +1055,9 @@ void KytheGraphObserver::assignUsr(const NodeId& node, llvm::StringRef usr,
std::min(hash.size(), static_cast<size_t>(byte_size))));
VNameRef node_vname = VNameRefFromNodeId(node);
VNameRef usr_vname;
usr_vname.set_corpus(usr_default_corpus_ ? default_token_.vname().corpus()
: "");
usr_vname.set_corpus(usr_default_corpus_
? absl::string_view(default_token_.vname().corpus())
: "");
usr_vname.set_signature(hex);
usr_vname.set_language("usr");
recorder_->AddProperty(usr_vname, NodeKindID::kClangUsr);
Expand Down

0 comments on commit aefac5c

Please sign in to comment.