add guards to prevent unfolded 'ConstantExpr' from sneaking into 'lConstantElementsToMask' - we handle only Ints and Doubles there

This commit is contained in:
Anton Mitrokhin
2014-12-04 17:13:07 +03:00
parent f0a5db068f
commit 91ee4ea7b6

View File

@@ -367,6 +367,8 @@ lGetMask(llvm::Value *factor, uint64_t *mask) {
llvm::dyn_cast<llvm::Constant>(cv->getOperand(i));
if (c == NULL)
return false;
if (llvm::isa<llvm::ConstantExpr>(cv->getOperand(i)) )
return false; // We can not handle constant expressions here
elements.push_back(c);
}
*mask = lConstElementsToMask(elements);