aboutsummaryrefslogtreecommitdiff
path: root/clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
diff options
context:
space:
mode:
authorKaining Zhong <zhongkaining.paxos@bytedance.com>2021-10-20 11:20:21 -0400
committerVy Nguyen <vyng@google.com>2021-10-20 11:21:40 -0400
commitaab0f2264aebe6cb89d5dcb30df664bfc4d8f1c3 (patch)
tree2bec2bedf50e19cd9b06d84b814268e3443900ec /clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp
parent3d152bc49ddc87350eb1c588b083b24858bf6d51 (diff)
downloadllvm-aab0f2264aebe6cb89d5dcb30df664bfc4d8f1c3.zip
llvm-aab0f2264aebe6cb89d5dcb30df664bfc4d8f1c3.tar.gz
llvm-aab0f2264aebe6cb89d5dcb30df664bfc4d8f1c3.tar.bz2
[lld-macho] Fix dangling string reference when adding frameworks
In Driver.cpp, addFramework used std::string instance to represent the path of a framework, which will be freed after the function returns. However, this string is stored in loadedArchive, which will be used later to compare with path of newly added frameworks. This caused https://bugs.llvm.org/show_bug.cgi?id=52133. A test is included in this commit to reproduce this bug. Now resolveDylibPath returns a StringRef instance, and it uses StringSaver to save its data, then returns it to functions on the top. This ensures the resolved framework path is still valid after LC_LINKER_OPTION is parsed. Reviewed By: int3, #lld-macho, oontvoo Differential Revision: https://reviews.llvm.org/D111706
Diffstat (limited to 'clang/lib/FrontendTool/ExecuteCompilerInvocation.cpp')
0 files changed, 0 insertions, 0 deletions