diff options
author | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-08 23:29:59 +0000 |
---|---|---|
committer | Richard Smith <richard-llvm@metafoo.co.uk> | 2017-12-08 23:29:59 +0000 |
commit | 354abec3e6b6132c9456de39951e8de0632771cc (patch) | |
tree | 191681e24af3adddd85524ec72439ac5c192d3f5 /clang/lib/Sema/SemaExprCXX.cpp | |
parent | a5370fb82c8e2f9e7676a78677d2730b2512a082 (diff) | |
download | bcm5719-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/SemaExprCXX.cpp')
-rw-r--r-- | clang/lib/Sema/SemaExprCXX.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaExprCXX.cpp b/clang/lib/Sema/SemaExprCXX.cpp index e4634d96d1d..cd0d7157415 100644 --- a/clang/lib/Sema/SemaExprCXX.cpp +++ b/clang/lib/Sema/SemaExprCXX.cpp @@ -3840,7 +3840,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, << From->getSourceRange(); } - CastKind Kind = CK_Invalid; + CastKind Kind; CXXCastPath BasePath; if (CheckPointerConversion(From, ToType, Kind, BasePath, CStyle)) return ExprError(); @@ -3860,7 +3860,7 @@ Sema::PerformImplicitConversion(Expr *From, QualType ToType, } case ICK_Pointer_Member: { - CastKind Kind = CK_Invalid; + CastKind Kind; CXXCastPath BasePath; if (CheckMemberPointerConversion(From, ToType, Kind, BasePath, CStyle)) return ExprError(); |