summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhigang Gong <zhigang.gong@intel.com>2015-04-03 07:23:15 +0800
committerZhigang Gong <zhigang.gong@intel.com>2015-04-13 16:11:46 +0800
commit8853578ec6c479134131d03e2c7ec2761c6a71d2 (patch)
tree6a23a6a0ff00038f6cef19f9c0809633e7a2a2e4
parent1a80e7faaf349c17d91d13a066b797ccc9593122 (diff)
GBE: fix an potential assertion in constant expanding pass.
Using the inserPos is good enough. If using --insertPos, there is one potential issue when the insertPos is the head of a list then it will trigger an assertion. Signed-off-by: Zhigang Gong <zhigang.gong@intel.com> Reviewed-by: "Song, Ruiling" <ruiling.song@intel.com>
-rw-r--r--backend/src/llvm/ExpandConstantExpr.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/backend/src/llvm/ExpandConstantExpr.cpp b/backend/src/llvm/ExpandConstantExpr.cpp
index 2da765e1..5c5934ad 100644
--- a/backend/src/llvm/ExpandConstantExpr.cpp
+++ b/backend/src/llvm/ExpandConstantExpr.cpp
@@ -120,7 +120,7 @@ static Value *expandConstantVector(Instruction *InsertPt, ConstantVector *CV) {
Type *IntTy = IntegerType::get(CV->getContext(), 32);
BasicBlock::iterator InsertPos(InsertPt);
- IRBuilder<> IRB(--InsertPos);
+ IRBuilder<> IRB(InsertPos);
Value *vec = UndefValue::get(CV->getType());
for (int i = 0; i < elemNum; i++) {
Value *idx = ConstantInt::get(IntTy, i);