[Orc] Fix a bug in the LazyEmittingLayer - capture names by value (as
authorLang Hames <lhames@gmail.com>
Tue, 10 Feb 2015 07:35:39 +0000 (07:35 +0000)
committerLang Hames <lhames@gmail.com>
Tue, 10 Feb 2015 07:35:39 +0000 (07:35 +0000)
commite65664e90da84395a0b6e65d7bd393a1e8a63533
tree104467b95dd29bb3c22a998165ab5b384c24b321
parentb7387a07d049a4024f80c0e09dba179984f8618d
[Orc] Fix a bug in the LazyEmittingLayer - capture names by value (as
std::strings) rather than StringRefs in JITSymbol get-address lambda.

Capturing a StringRef by-value is still effectively capturing a reference, which
is no good here because the referenced string may be gone by the time the lambda
is being evaluated the original value may be gone. Make sure to capture a
std::string instead.

No test case: This bug doesn't manifest under OrcMCJITReplacement, since it
keeps IR modules (from which the StringRefs are sourced) alive permanently.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@228676 91177308-0d34-0410-b5e6-96231b3b80d8
include/llvm/ExecutionEngine/Orc/LazyEmittingLayer.h