This is an archive of the discontinued LLVM Phabricator instance.

[MCParser] Add warning for zero-size .fill
Needs ReviewPublic

Authored by jacobly on Apr 25 2023, 4:02 PM.

Details

Reviewers
grosbach
Summary

Adding an early return for a 0 size avoids this assertion:

llvm-mc: llvm/lib/MC/MCStreamer.cpp:135: virtual void llvm::MCStreamer::emitIntValue(uint64_t, unsigned int): Assertion `1 <= Size && Size <= 8 && "Invalid size"' failed.

Diff Detail

Event Timeline

jacobly created this revision.Apr 25 2023, 4:02 PM
Herald added a project: Restricted Project. · View Herald TranscriptApr 25 2023, 4:02 PM
Herald added a subscriber: hiraditya. · View Herald Transcript
jacobly requested review of this revision.Apr 25 2023, 4:02 PM

test case missing.

arsenm added a subscriber: arsenm.Apr 25 2023, 4:12 PM
arsenm added inline comments.
llvm/lib/MC/MCParser/AsmParser.cpp
3357–3364

Could you just have one message with the value instead

jacobly updated this revision to Diff 516968.Apr 25 2023, 4:19 PM
jacobly updated this revision to Diff 516976.Apr 25 2023, 4:24 PM

Improve warning messages.

jacobly marked an inline comment as done.Apr 25 2023, 4:25 PM
jacobly added inline comments.
llvm/lib/MC/MCParser/AsmParser.cpp
3357–3364

Good idea.

jacobly updated this revision to Diff 516977.Apr 25 2023, 4:26 PM
jacobly marked an inline comment as done.

Fix typo.

jacobly edited the summary of this revision. (Show Details)Apr 25 2023, 5:39 PM