Bug 14827 – [REG 2.068] std.string.strip handles Unicode incorrectly with -O -inline

Status
RESOLVED
Resolution
DUPLICATE
Severity
regression
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2015-07-26T01:24:00Z
Last change time
2015-07-28T02:47:47Z
Keywords
wrong-code
Assigned to
nobody
Creator
gassa

Attachments

IDFilenameSummaryContent-TypeSize
1532example.dexample codetext/plain176

Comments

Comment #0 by gassa — 2015-07-26T01:24:46Z
import std.conv, std.range, std.stdio, std.string, std.uni; void main () { string s = "Тест"; writeln (s.front); // "T", right writeln (s.front.isWhite); // false, right writeln (s.strip); // "Тест" expected, "ест" found } 2.067.1: OK 2.068.0-b1 and 2.068.0-b2, compiled with "dmd -O -inline -m32": s.strip eats the first Cyrillic letter. On the other hand, "-m64" version works fine.
Comment #1 by gassa — 2015-07-26T01:25:38Z
Created attachment 1532 example code
Comment #2 by ag0aep6g — 2015-07-26T09:19:07Z
Can confirm on linux with git head dmd (v2.068-devel-494a91d) and -m64.
Comment #3 by gassa — 2015-07-26T09:57:18Z
To clarify: for me, it (1) works correctly on *Windows* with -m64 and (2) fails on *Windows* with -m32.
Comment #4 by ag0aep6g — 2015-07-26T11:21:03Z
Digger says this introduced the regression: https://github.com/D-Programming-Language/phobos/pull/3187 But that just exposed the compiler bug. Filed a new issue for it: issue 14829. The phobos regression at hand may be fixed by fixing the compiler bug, or by working around it.
Comment #5 by bugzilla — 2015-07-28T02:47:47Z
*** This issue has been marked as a duplicate of issue 14829 ***