This is an archive of the discontinued LLVM Phabricator instance.

[MC] Return early when .fill size is negative
ClosedPublic

Authored by phosek on May 28 2016, 1:18 AM.

Details

Summary

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

Diff Detail

Repository
rL LLVM

Event Timeline

phosek updated this revision to Diff 58883.May 28 2016, 1:18 AM
phosek retitled this revision from to [MC] Return early when .fill size is negative.
phosek updated this object.
phosek added a reviewer: rafael.
phosek set the repository for this revision to rL LLVM.
phosek added subscribers: rafael, phosek, llvm-commits.
phosek added a comment.EditedMay 28 2016, 1:22 AM

This triggers an error on ubsan build because of an invalid shift in MCStreamer::emitFill because of the negative Size. This is not a bug; even though Expr has an incorrect value, it's never used because NumValues is set to 0, but we want to avoid further ubsan failures.

This revision was automatically updated to reflect the committed changes.