This is an archive of the discontinued LLVM Phabricator instance.

[clangd] Fix use-after-free in SymbolYAML: strings are owned by yaml::Input!
ClosedPublic

Authored by sammccall on Feb 16 2018, 4:42 AM.

Details

Summary

There are a few implementation options here - alternatives are either both
awkward and inefficient, or really inefficient.
This is at least potentially a hot path when used as a reducer for common
symbols.

Diff Detail

Repository
rL LLVM

Event Timeline

sammccall created this revision.Feb 16 2018, 4:42 AM
ioeric accepted this revision.Feb 16 2018, 4:51 AM

Thanks a lot for the fix!

Suggest a test case which reproduced the bug:

// comment with 'quote'
void f() {}

runSymbolCollector -> SymbolToYAML -> SymbolFromYAML -> check Documentation

This revision is now accepted and ready to land.Feb 16 2018, 4:51 AM
This revision was automatically updated to reflect the committed changes.