[PATCH] D121678: [pseudo] Split greatergreater token.

Haojian Wu via Phabricator via cfe-commits cfe-commits at lists.llvm.org
Mon Mar 21 07:51:47 PDT 2022


hokein added a comment.

Thanks for the report and revert, and sorry for the failures and the late response (was OOO on Friday).

> One of our guys speculates that because some allocations are "owned" by the returned TokenStream, but the returned TokenStream is a temporary, the lifetimes might not be sufficient and some deallocations can happen.
> If I change the nested calls stripComments(cook(lex(Code, Opts), Opts)) to separate calls stored to separate locals, the problem goes away.

Thanks for diagnosing it. Yeah, this is the root cause. `cook` returns a tokenStream (which has its own payload), and this token stream is a temporary and being destroyed after the `stripComments` statement, and we have dangling pointers. I will prepare a fix.


Repository:
  rG LLVM Github Monorepo

CHANGES SINCE LAST ACTION
  https://reviews.llvm.org/D121678/new/

https://reviews.llvm.org/D121678



More information about the cfe-commits mailing list