[Mlir-commits] [mlir] 868bd99 - [mlir] Add assertion in NamedAttrList to prevent adding null attributes
Tres Popp
llvmlistbot at llvm.org
Wed Aug 25 02:08:20 PDT 2021
Author: Tres Popp
Date: 2021-08-25T11:06:53+02:00
New Revision: 868bd9938db1c13a9efe68263b99c0d3752e50ba
URL: https://github.com/llvm/llvm-project/commit/868bd9938db1c13a9efe68263b99c0d3752e50ba
DIFF: https://github.com/llvm/llvm-project/commit/868bd9938db1c13a9efe68263b99c0d3752e50ba.diff
LOG: [mlir] Add assertion in NamedAttrList to prevent adding null attributes
Differential Revision: https://reviews.llvm.org/D108570
Added:
Modified:
mlir/lib/IR/OperationSupport.cpp
Removed:
################################################################################
diff --git a/mlir/lib/IR/OperationSupport.cpp b/mlir/lib/IR/OperationSupport.cpp
index ca4debe21f8e1..5b472db8c3f4b 100644
--- a/mlir/lib/IR/OperationSupport.cpp
+++ b/mlir/lib/IR/OperationSupport.cpp
@@ -72,6 +72,7 @@ void NamedAttrList::assign(const_iterator in_start, const_iterator in_end) {
}
void NamedAttrList::push_back(NamedAttribute newAttribute) {
+ assert(newAttribute.second && "unexpected null attribute");
if (isSorted())
dictionarySorted.setInt(
attrs.empty() ||
More information about the Mlir-commits
mailing list