Thread overview
[Issue 13471] CTFE glitch when executing std.digest.crc.crc32Of() and checking the result with enforce(). (keyword: uninitialized variable)
Jan 20, 2015
Kenji Hara
Jul 02, 2017
Vladimir Panteleev
May 22, 2019
Dlang Bot
May 23, 2019
Nathan S.
May 23, 2019
Dlang Bot
January 20, 2015
https://issues.dlang.org/show_bug.cgi?id=13471

Kenji Hara <k.hara.pg@gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Hardware|x86_64                      |All

--- Comment #1 from Kenji Hara <k.hara.pg@gmail.com> ---
Reduced test case. Switch the error messages by -version=check.

enum buggy1 = foo("Hello World!");

ubyte[4] foo(string str)
{
    uint _state = uint.max;
    ubyte[4] result = nativeToLittleEndian(~_state);

    version(check)
    {
        import std.exception;
        enforce(result != (ubyte[4]).init, "this should not be thrown");
    }
    return result;
}

union EndianSwapper(T)
{
    T value;
    ubyte[T.sizeof] array;
}

auto nativeToLittleEndian(T)(T val)
{
    return nativeToLittleEndianImpl(val);
}

auto nativeToLittleEndianImpl(T)(T val)
{
    EndianSwapper!T es = void;
    es.value = val;
    return es.array;
}

--
July 02, 2017
https://issues.dlang.org/show_bug.cgi?id=13471

Vladimir Panteleev <dlang-bugzilla@thecybershadow.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |diagnostic

--
May 22, 2019
https://issues.dlang.org/show_bug.cgi?id=13471

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Keywords|                            |pull

--- Comment #2 from Dlang Bot <dlang-bot@dlang.rocks> ---
@thewilsonator updated dlang/phobos pull request #6976 "Fix issue 13741: can't use crc at CTFE" fixing this issue:

- Fix issue 13471: can't use crc at CTFE

https://github.com/dlang/phobos/pull/6976

--
May 23, 2019
https://issues.dlang.org/show_bug.cgi?id=13471

Nathan S. <n8sh.secondary@hotmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
         Depends on|                            |19892


Referenced Issues:

https://issues.dlang.org/show_bug.cgi?id=19892
[Issue 19892] Add CTFE support for std.bitmanip: nativeToBigEndian,
bigEndianToNative, littleEndianToNative, nativeToLittleEndian
--
May 23, 2019
https://issues.dlang.org/show_bug.cgi?id=13471
Issue 13471 depends on issue 19892, which changed state.

Issue 19892 Summary: Add CTFE support for std.bitmanip: nativeToBigEndian, bigEndianToNative, littleEndianToNative, nativeToLittleEndian
https://issues.dlang.org/show_bug.cgi?id=19892

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--
May 23, 2019
https://issues.dlang.org/show_bug.cgi?id=13471

Dlang Bot <dlang-bot@dlang.rocks> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|---                         |FIXED

--- Comment #3 from Dlang Bot <dlang-bot@dlang.rocks> ---
dlang/phobos pull request #6976 "Fix issue 13471: can't use crc at CTFE" was merged into master:

- 516432d185bf4ace339f7e571f1b46894e8536aa by Nicholas Lindsay Wilson:
  Fix issue 13471: can't use crc at CTFE

https://github.com/dlang/phobos/pull/6976

--