projects
/
platform
/
upstream
/
llvm.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a6d76cf
)
Fix Block::eraseArguments to properly update the cached positions
author
Mehdi Amini
<joker.eph@gmail.com>
Sat, 27 Feb 2021 19:04:12 +0000
(19:04 +0000)
committer
Mehdi Amini
<joker.eph@gmail.com>
Sat, 27 Feb 2021 19:04:12 +0000
(19:04 +0000)
This is fixing correctness and ASAN failure post-
ee90bb3486948
.
mlir/lib/IR/Block.cpp
patch
|
blob
|
history
diff --git
a/mlir/lib/IR/Block.cpp
b/mlir/lib/IR/Block.cpp
index
2ae983d
..
0758d1e
100644
(file)
--- a/
mlir/lib/IR/Block.cpp
+++ b/
mlir/lib/IR/Block.cpp
@@
-200,9
+200,8
@@
void Block::eraseArguments(llvm::BitVector eraseIndices) {
}
}
// Update the cached position for the arguments after the first erased one.
- int64_t index = 0;
- for (BlockArgument arg :
- llvm::drop_begin(arguments, eraseIndices.find_first()))
+ int64_t index = eraseIndices.find_first();
+ for (BlockArgument arg : llvm::drop_begin(arguments, index))
arg.setArgNumber(index++);
}