summaryrefslogtreecommitdiff
path: root/include/llvm/FuzzMutate/OpDescriptor.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/llvm/FuzzMutate/OpDescriptor.h')
-rw-r--r--include/llvm/FuzzMutate/OpDescriptor.h6
1 files changed, 5 insertions, 1 deletions
diff --git a/include/llvm/FuzzMutate/OpDescriptor.h b/include/llvm/FuzzMutate/OpDescriptor.h
index e9f8bf09a79b..dd30fda99bea 100644
--- a/include/llvm/FuzzMutate/OpDescriptor.h
+++ b/include/llvm/FuzzMutate/OpDescriptor.h
@@ -20,6 +20,7 @@
#include "llvm/ADT/SmallVector.h"
#include "llvm/IR/Constants.h"
#include "llvm/IR/DerivedTypes.h"
+#include "llvm/IR/Instructions.h"
#include "llvm/IR/Type.h"
#include "llvm/IR/Value.h"
#include <functional>
@@ -128,7 +129,7 @@ static inline SourcePred anyFloatType() {
static inline SourcePred anyPtrType() {
auto Pred = [](ArrayRef<Value *>, const Value *V) {
- return V->getType()->isPointerTy();
+ return V->getType()->isPointerTy() && !V->isSwiftError();
};
auto Make = [](ArrayRef<Value *>, ArrayRef<Type *> Ts) {
std::vector<Constant *> Result;
@@ -142,6 +143,9 @@ static inline SourcePred anyPtrType() {
static inline SourcePred sizedPtrType() {
auto Pred = [](ArrayRef<Value *>, const Value *V) {
+ if (V->isSwiftError())
+ return false;
+
if (const auto *PtrT = dyn_cast<PointerType>(V->getType()))
return PtrT->getElementType()->isSized();
return false;