[all-commits] [llvm/llvm-project] 76910d: [pseudo] Share the underly payload when stripping ...
Haojian Wu via All-commits
all-commits at lists.llvm.org
Fri Jul 15 06:21:03 PDT 2022
Branch: refs/heads/main
Home: https://github.com/llvm/llvm-project
Commit: 76910d4a56c8dba000f198bba13e71cf0492c8cb
https://github.com/llvm/llvm-project/commit/76910d4a56c8dba000f198bba13e71cf0492c8cb
Author: Haojian Wu <hokein.wu at gmail.com>
Date: 2022-07-15 (Fri, 15 Jul 2022)
Changed paths:
M clang-tools-extra/pseudo/include/clang-pseudo/Token.h
M clang-tools-extra/pseudo/lib/Lex.cpp
M clang-tools-extra/pseudo/lib/Token.cpp
Log Message:
-----------
[pseudo] Share the underly payload when stripping comments for a token stream
`stripComments(cook(...))` is a common pattern being written.
Without this patch, this has a use-after-free issue (cook returns a temporary
TokenStream object which has its own payload, but the payload is not
shared with the one returned by stripComments).
Reviewed By: sammccall
Differential Revision: https://reviews.llvm.org/D125311
More information about the All-commits
mailing list