[Mlir-commits] [mlir] 30846d2 - Guard copy of std::function to llvm::function_ref (fix crash)
Mehdi Amini
llvmlistbot at llvm.org
Tue Apr 12 00:44:16 PDT 2022
Author: Mehdi Amini
Date: 2022-04-12T07:44:04Z
New Revision: 30846d2916a604c5746d0a421b913ea3729c0d12
URL: https://github.com/llvm/llvm-project/commit/30846d2916a604c5746d0a421b913ea3729c0d12
DIFF: https://github.com/llvm/llvm-project/commit/30846d2916a604c5746d0a421b913ea3729c0d12.diff
LOG: Guard copy of std::function to llvm::function_ref (fix crash)
This is a footgun: assigning a null std::function to a function_ref
does not yield a null function_ref...
Added:
Modified:
mlir/lib/ExecutionEngine/JitRunner.cpp
Removed:
################################################################################
diff --git a/mlir/lib/ExecutionEngine/JitRunner.cpp b/mlir/lib/ExecutionEngine/JitRunner.cpp
index 824d8f56ab6d2..df9ec290bb947 100644
--- a/mlir/lib/ExecutionEngine/JitRunner.cpp
+++ b/mlir/lib/ExecutionEngine/JitRunner.cpp
@@ -205,7 +205,8 @@ static Error compileAndExecute(Options &options, ModuleOp module,
mlir::ExecutionEngineOptions engineOptions;
engineOptions.llvmModuleBuilder = config.llvmModuleBuilder;
- engineOptions.transformer = config.transformer;
+ if (config.transformer)
+ engineOptions.transformer = config.transformer;
engineOptions.jitCodeGenOptLevel = jitCodeGenOptLevel;
engineOptions.sharedLibPaths = executionEngineLibs;
engineOptions.enableObjectCache = true;
More information about the Mlir-commits
mailing list