[MC] Return early when .fill size is negative

Rather than invoking emitFill with negative size, which may trigger
an undefined behavior, return immediately after emitting the warning.

Differential Revision: http://reviews.llvm.org/D20768

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@271107 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
Petr Hosek 2016-05-28 08:20:08 +00:00
parent c12ac37f8d
commit c6eef17f1f

View File

@ -2801,7 +2801,7 @@ bool AsmParser::parseDirectiveFill() {
if (FillSize < 0) {
Warning(SizeLoc, "'.fill' directive with negative size has no effect");
NumValues = MCConstantExpr::create(0, getStreamer().getContext());
return false;
}
if (FillSize > 8) {
Warning(SizeLoc, "'.fill' directive with size greater than 8 has been truncated to 8");