Bug 14105 – strideImpl fails for 0xFF

Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86
OS
Mac OS X
Creation time
2015-02-01T23:00:00Z
Last change time
2015-02-18T03:41:56Z
Keywords
pull
Assigned to
nobody
Creator
andrei

Comments

Comment #0 by andrei — 2015-02-01T23:00:38Z
In Phobos' std/utf.d there's a unittest: unittest // invalid start bytes { import std.exception: assertThrown; immutable char[] invalidStartBytes = [ //0b1111_1000, // indicating a sequence length of 5 0b1111_1100, // 6 0b1111_1110, // 7 0b1111_1111, // 8 0b1000_0000, // continuation byte ]; foreach(c; invalidStartBytes) assertThrown!UTFException(stride([c])); } Uncommenting the first element of the array makes the unittest fail. Actually uncommenting that but commenting another element of the array makes the unittest pass. The error cannot be reproduced by taking the unittest out.
Comment #1 by andrei — 2015-02-01T23:02:29Z
Comment #2 by code — 2015-02-02T12:16:58Z
Comment #3 by github-bugzilla — 2015-02-02T15:42:39Z
Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/dcf18a0d20a8019fc5a374afd58d99d10c642a82 fix Issue 14105 - strideImpl fails for 0xFF - bsr(0) returns an undefined result https://github.com/D-Programming-Language/phobos/commit/e65a331ebdd375603b92209fb693d02561eb0055 Merge pull request #2951 from MartinNowak/fix14105 fix Issue 14105 - strideImpl fails for 0xFF
Comment #4 by github-bugzilla — 2015-02-18T03:41:56Z