aboutsummaryrefslogtreecommitdiff
path: root/lib/Sema/SemaAttr.cpp
diff options
context:
space:
mode:
authorDouglas Gregor <dgregor@apple.com>2010-05-18 23:01:22 +0000
committerDouglas Gregor <dgregor@apple.com>2010-05-18 23:01:22 +0000
commitac06a0e1e3feb95c2ffd352c086882b492a65b99 (patch)
treef4218af7c11eab49adff4c1b003df39b6a26036b /lib/Sema/SemaAttr.cpp
parentfb4a5436839aae5f5599f2970997e23ee6b895b6 (diff)
Protect isIntegerConstantExpr from seeing type- or value-dependent
expressions in attributes, pragmas. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@104083 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Sema/SemaAttr.cpp')
-rw-r--r--lib/Sema/SemaAttr.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/Sema/SemaAttr.cpp b/lib/Sema/SemaAttr.cpp
index 095f537f71..dc7815fa64 100644
--- a/lib/Sema/SemaAttr.cpp
+++ b/lib/Sema/SemaAttr.cpp
@@ -106,7 +106,9 @@ void Sema::ActOnPragmaPack(PragmaPackKind Kind, IdentifierInfo *Name,
// pack(0) is like pack(), which just works out since that is what
// we use 0 for in PackAttr.
- if (!Alignment->isIntegerConstantExpr(Val, Context) ||
+ if (Alignment->isTypeDependent() ||
+ Alignment->isValueDependent() ||
+ !Alignment->isIntegerConstantExpr(Val, Context) ||
!(Val == 0 || Val.isPowerOf2()) ||
Val.getZExtValue() > 16) {
Diag(PragmaLoc, diag::warn_pragma_pack_invalid_alignment);