summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/Sema.cpp
diff options
context:
space:
mode:
authorRichard Smith <richard-llvm@metafoo.co.uk>2017-12-08 23:29:59 +0000
committerRichard Smith <richard-llvm@metafoo.co.uk>2017-12-08 23:29:59 +0000
commit354abec3e6b6132c9456de39951e8de0632771cc (patch)
tree191681e24af3adddd85524ec72439ac5c192d3f5 /clang/lib/Sema/Sema.cpp
parenta5370fb82c8e2f9e7676a78677d2730b2512a082 (diff)
downloadbcm5719-llvm-354abec3e6b6132c9456de39951e8de0632771cc.tar.gz
bcm5719-llvm-354abec3e6b6132c9456de39951e8de0632771cc.zip
Remove creation of out-of-bounds value of enumeration type (resulting in UB).
Also remove unnecessary initialization of out-parameters with this value, so that MSan is able to catch errors appropriately. llvm-svn: 320212
Diffstat (limited to 'clang/lib/Sema/Sema.cpp')
-rw-r--r--clang/lib/Sema/Sema.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/Sema.cpp b/clang/lib/Sema/Sema.cpp
index 31400e1de89..4e57e5ef81c 100644
--- a/clang/lib/Sema/Sema.cpp
+++ b/clang/lib/Sema/Sema.cpp
@@ -529,7 +529,7 @@ CastKind Sema::ScalarTypeToBooleanCastKind(QualType ScalarTy) {
case Type::STK_IntegralComplex: return CK_IntegralComplexToBoolean;
case Type::STK_FloatingComplex: return CK_FloatingComplexToBoolean;
}
- return CK_Invalid;
+ llvm_unreachable("unknown scalar type kind");
}
/// \brief Used to prune the decls of Sema's UnusedFileScopedDecls vector.
OpenPOWER on IntegriCloud