Skip to content

Commit 92735cc

Browse files
committed
Fix dangling IPOAmendableCB function_ref.
A temporary lambda is assigned to a llvm::function_ref, this lambda is destroyed at the end of the full expression, any use of the function_ref afterwards is undefined behavior.
1 parent 5656cbc commit 92735cc

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/include/llvm/Transforms/IPO/Attributor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1478,7 +1478,7 @@ struct AttributorConfig {
14781478
/// The name of the pass running the attributor, used to emit remarks.
14791479
const char *PassName = nullptr;
14801480

1481-
using IPOAmendableCBTy = function_ref<bool(const Function &F)>;
1481+
using IPOAmendableCBTy = std::function<bool(const Function &F)>;
14821482
IPOAmendableCBTy IPOAmendableCB;
14831483
};
14841484

0 commit comments

Comments
 (0)