This is an archive of the discontinued LLVM Phabricator instance.

Keep an instance of COFFOptTable alive as long as InputArgList is alive.
ClosedPublic

Authored by ruiu on Aug 28 2017, 9:24 AM.

Details

Summary

ArgParser created an instance of COFFOptTable on stack to use it to
parser command line arguments. Parsed arguments were then returned from
the function as InputArgList. This was safe because InputArgList referred
only statically-allocated InfoTable.

That is not a safe assumption after https://reviews.llvm.org/D36782,
which changes the type of its internal table from ArrayRef to std::vector.
To make lld work with that patch, we need to keep an instance of
COFFOptTable at least as long as an InputArgList is alive. This patch
does that.

Diff Detail

Repository
rL LLVM

Event Timeline

ruiu created this revision.Aug 28 2017, 9:24 AM
yamaguchi accepted this revision.Aug 28 2017, 12:51 PM

I think this way is more reasonable than mine. Thank you very much!

This revision is now accepted and ready to land.Aug 28 2017, 12:51 PM
This revision was automatically updated to reflect the committed changes.