llvm-mc: In a .fill directive, still honor .align even if invalid maximum bytes
authorDaniel Dunbar <daniel@zuster.org>
Fri, 21 Aug 2009 23:01:53 +0000 (23:01 +0000)
committerDaniel Dunbar <daniel@zuster.org>
Fri, 21 Aug 2009 23:01:53 +0000 (23:01 +0000)
count is given (this matches 'as').

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@79683 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-mc/AsmParser.cpp

index f67bad164a26f60a7d04f1882aa43f5984daf38f..9db0ac0351b69b2f827ac0c963c46f11c3937e9f 100644 (file)
@@ -1072,12 +1072,13 @@ bool AsmParser::ParseDirectiveAlign(bool IsPow2, unsigned ValueSize) {
     Alignment = 1LL << Alignment;
   }
 
-  // Diagnose non-sensical max bytes to fill.
+  // Diagnose non-sensical max bytes to fill, which are treated as missing (this
+  // matches 'as').
   if (MaxBytesLoc.isValid()) {
     if (MaxBytesToFill < 1) {
       Warning(MaxBytesLoc, "alignment directive can never be satisfied in this "
-              "many bytes, ignoring");
-      return false;
+              "many bytes, ignoring maximum bytes expression");
+      MaxBytesToFill = 0;
     }
 
     if (MaxBytesToFill >= Alignment) {