[PATCH] D149212: [MCParser] Add warning for zero-size .fill
Jacob Young via Phabricator via llvm-commits
llvm-commits at lists.llvm.org
Tue Apr 25 16:19:14 PDT 2023
jacobly updated this revision to Diff 516968.
CHANGES SINCE LAST ACTION
https://reviews.llvm.org/D149212/new/
https://reviews.llvm.org/D149212
Files:
llvm/lib/MC/MCParser/AsmParser.cpp
llvm/test/MC/AsmParser/directive_fill.s
Index: llvm/test/MC/AsmParser/directive_fill.s
===================================================================
--- llvm/test/MC/AsmParser/directive_fill.s
+++ llvm/test/MC/AsmParser/directive_fill.s
@@ -77,3 +77,6 @@
TEST13:
.fill TEST11 - TEST12+i, 4, 0x12345678
+# CHECK-WARNINGS: '.fill' directive with 0 size has no effect
+TEST14:
+ .fill 1, 0
Index: llvm/lib/MC/MCParser/AsmParser.cpp
===================================================================
--- llvm/lib/MC/MCParser/AsmParser.cpp
+++ llvm/lib/MC/MCParser/AsmParser.cpp
@@ -3354,6 +3354,10 @@
if (parseEOL())
return true;
+ if (FillSize == 0) {
+ Warning(SizeLoc, "'.fill' directive with 0 size has no effect");
+ return false;
+ }
if (FillSize < 0) {
Warning(SizeLoc, "'.fill' directive with negative size has no effect");
return false;
-------------- next part --------------
A non-text attachment was scrubbed...
Name: D149212.516968.patch
Type: text/x-patch
Size: 845 bytes
Desc: not available
URL: <http://lists.llvm.org/pipermail/llvm-commits/attachments/20230425/fe8b29dc/attachment.bin>
More information about the llvm-commits
mailing list