From 382da62ec274feead85e7be364ab5d4fd0281d98 Mon Sep 17 00:00:00 2001 From: Nick Lewycky Date: Mon, 15 Dec 2008 07:29:55 +0000 Subject: It turns out that "align 1" and unaligned are different. Add a bias to the alignment attribute such that 0 means unaligned. This will probably require a rebuild of llvm-gcc because of the change to Attributes.h. If you see many test failures on "make check", please rebuild your llvm-gcc. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@61030 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/AsmParser/llvmAsmParser.y | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'lib/AsmParser/llvmAsmParser.y') diff --git a/lib/AsmParser/llvmAsmParser.y b/lib/AsmParser/llvmAsmParser.y index 350584f432..7028ea3fe0 100644 --- a/lib/AsmParser/llvmAsmParser.y +++ b/lib/AsmParser/llvmAsmParser.y @@ -1332,6 +1332,8 @@ OptAlign : /*empty*/ { $$ = 0; } | $$ = $2; if ($$ != 0 && !isPowerOf2_32($$)) GEN_ERROR("Alignment must be a power of two"); + if ($$ > 0x40000000) + GEN_ERROR("Alignment too large"); CHECK_FOR_ERROR }; OptCAlign : /*empty*/ { $$ = 0; } | @@ -1339,6 +1341,8 @@ OptCAlign : /*empty*/ { $$ = 0; } | $$ = $3; if ($$ != 0 && !isPowerOf2_32($$)) GEN_ERROR("Alignment must be a power of two"); + if ($$ > 0x40000000) + GEN_ERROR("Alignment too large"); CHECK_FOR_ERROR }; @@ -1368,6 +1372,8 @@ GlobalVarAttribute : SectionString { | ALIGN EUINT64VAL { if ($2 != 0 && !isPowerOf2_32($2)) GEN_ERROR("Alignment must be a power of two"); + if ($2 > 0x40000000) + GEN_ERROR("Alignment too large"); CurGV->setAlignment($2); CHECK_FOR_ERROR }; -- cgit v1.2.3-18-g5258