]> granicus.if.org Git - clang/commit
[Sema] Use CK_NoOp instead CK_Invalid in tryGCCVectorConvertAndSplat
authorVitaly Buka <vitalybuka@google.com>
Mon, 15 May 2017 22:04:03 +0000 (22:04 +0000)
committerVitaly Buka <vitalybuka@google.com>
Mon, 15 May 2017 22:04:03 +0000 (22:04 +0000)
commit8c199f23fb6405e08d4f888dfdd141a895ee5413
treed5393e868783f85d2852f02d440caf4ca4c82e4b
parentc86b5c3e538c82622709e63d168e6147cb22aaea
[Sema] Use CK_NoOp instead CK_Invalid in tryGCCVectorConvertAndSplat

This fix UBSAN bots after r302935. Storing non-defined values in enum is
undefined behavior.

Other places, where "if (ScalarCast != CK_Invalid)" is used, never get to the
"if" with CK_Invalid. tryGCCVectorConvertAndSplat can get to the "if" with
CK_Invalid and it looks like expected case. So we have to use something other
than CK_Invalid, e.g. CK_NoOp.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@303121 91177308-0d34-0410-b5e6-96231b3b80d8
lib/Sema/SemaExpr.cpp