[Issue 21038] Wrong codegen when calling wcslen
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat Jul 11 20:12:20 UTC 2020
https://issues.dlang.org/show_bug.cgi?id=21038
ag0aep6g <ag0aep6g at gmail.com> changed:
What |Removed |Added
----------------------------------------------------------------------------
Keywords| |wrong-code
CC| |ag0aep6g at gmail.com
--- Comment #1 from ag0aep6g <ag0aep6g at gmail.com> ---
The string data is getting misaligned. wcslen assumes properly aligned data.
testabcd.d can be reduced to this:
----
alias wchar_t = dchar;
const(wchar_t)* name = "abcd";
void test()
{
assert((cast(size_t) name) % wchar_t.sizeof == 0); /* Fails. Should pass.
*/
}
----
--
More information about the Digitalmars-d-bugs
mailing list