[PATCH] D15742: Fix infinite recursion in MCAsmStreamer::EmitValueImpl

Rafael EspĂ­ndola via llvm-commits llvm-commits at lists.llvm.org
Wed Dec 23 09:34:16 PST 2015


Can this be tested?

EmissionSize can now go out of the loop.

The comment just before the code you changed needs to be updated.

On 23 December 2015 at 07:09, Alexandru Guduleasa via llvm-commits
<llvm-commits at lists.llvm.org> wrote:
> alexandru.guduleasa created this revision.
> alexandru.guduleasa added reviewers: llvm-commits, majnemer.
>
> If a target can only emit 8-bits data, it will loop in EmitValueImpl since it will try to split a 32-bits data in 1 chunk of 32-bits.
> Since we know that "Size" is not supported on the target, choose "EmissionSize" as the greatest power of 2, smaller than "Size".
>
> http://reviews.llvm.org/D15742
>
> Files:
>   lib/MC/MCAsmStreamer.cpp
>
> Index: lib/MC/MCAsmStreamer.cpp
> ===================================================================
> --- lib/MC/MCAsmStreamer.cpp
> +++ lib/MC/MCAsmStreamer.cpp
> @@ -715,10 +715,8 @@
>      for (unsigned Emitted = 0; Emitted != Size;) {
>        unsigned Remaining = Size - Emitted;
>        // The size of our partial emission must be a power of two less than
> -      // eight.
> -      unsigned EmissionSize = PowerOf2Floor(Remaining);
> -      if (EmissionSize > 4)
> -        EmissionSize = 4;
> +      // Size.
> +      unsigned EmissionSize = PowerOf2Floor(Size - 1);
>        // Calculate the byte offset of our partial emission taking into account
>        // the endianness of the target.
>        unsigned ByteOffset =
>
>
>
> _______________________________________________
> llvm-commits mailing list
> llvm-commits at lists.llvm.org
> http://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-commits
>


More information about the llvm-commits mailing list