forked from OSchip/llvm-project
[clang-fuzzer] CreateAndRunJITFunc - fix use after move static analyzer warning.
We were using the unique_ptr M to determine the triple after it had been moved in the EngineBuilder constructor.
This commit is contained in:
parent
cae4067ec1
commit
e4991867fb
|
@ -158,6 +158,8 @@ static void CreateAndRunJITFunc(const std::string &IR, CodeGenOpt::Level OLvl) {
|
|||
ErrorAndExit("Function not found in module");
|
||||
|
||||
std::string ErrorMsg;
|
||||
Triple ModuleTriple(M->getTargetTriple());
|
||||
|
||||
EngineBuilder builder(std::move(M));
|
||||
builder.setMArch(codegen::getMArch());
|
||||
builder.setMCPU(codegen::getCPUStr());
|
||||
|
@ -166,8 +168,6 @@ static void CreateAndRunJITFunc(const std::string &IR, CodeGenOpt::Level OLvl) {
|
|||
builder.setEngineKind(EngineKind::JIT);
|
||||
builder.setMCJITMemoryManager(std::make_unique<SectionMemoryManager>());
|
||||
builder.setOptLevel(OLvl);
|
||||
|
||||
Triple ModuleTriple(M->getTargetTriple());
|
||||
builder.setTargetOptions(
|
||||
codegen::InitTargetOptionsFromCodeGenFlags(ModuleTriple));
|
||||
|
||||
|
|
Loading…
Reference in New Issue