summaryrefslogtreecommitdiffstats
path: root/clang/lib/Sema/SemaExprMember.cpp
diff options
context:
space:
mode:
authorFariborz Jahanian <fjahanian@apple.com>2014-04-03 19:43:01 +0000
committerFariborz Jahanian <fjahanian@apple.com>2014-04-03 19:43:01 +0000
commit275542a40e38a321d2926b44659b926016446501 (patch)
tree0c3d2fbb9f9e69a861bccd28a352225625c890af /clang/lib/Sema/SemaExprMember.cpp
parent72cebdec2e203949fd57ef1376905e0980d4b370 (diff)
downloadbcm5719-llvm-275542a40e38a321d2926b44659b926016446501.tar.gz
bcm5719-llvm-275542a40e38a321d2926b44659b926016446501.zip
vector [Sema]. Check for proper use of 's' char prefix
(which indicates vector expression is a string of hex values) instead of crashing in code gen. // rdar://16492792 llvm-svn: 205557
Diffstat (limited to 'clang/lib/Sema/SemaExprMember.cpp')
-rw-r--r--clang/lib/Sema/SemaExprMember.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/clang/lib/Sema/SemaExprMember.cpp b/clang/lib/Sema/SemaExprMember.cpp
index 354dfcf3896..675c69fa88f 100644
--- a/clang/lib/Sema/SemaExprMember.cpp
+++ b/clang/lib/Sema/SemaExprMember.cpp
@@ -292,7 +292,7 @@ CheckExtVectorComponent(Sema &S, QualType baseType, ExprValueKind &VK,
// This flag determines whether or not CompName has an 's' char prefix,
// indicating that it is a string of hex values to be used as vector indices.
- bool HexSwizzle = *compStr == 's' || *compStr == 'S';
+ bool HexSwizzle = (*compStr == 's' || *compStr == 'S') && compStr[1];
bool HasRepeated = false;
bool HasIndex[16] = {};
OpenPOWER on IntegriCloud