Bug 207 – isUniAlpha crashes for values < 'A'

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D1 (retired)
Platform
x86
OS
Windows
Creation time
2006-06-18T13:36:00Z
Last change time
2014-02-15T13:28:57Z
Assigned to
bugzilla
Creator
lio+bugzilla

Comments

Comment #0 by lio+bugzilla — 2006-06-18T13:36:21Z
import std.uni; void main() { isUniAlpha(' ');//crash } Reason: isUniAlpha uses a binary search, with end condition "while (low<=high)", low and high being uints. At some point the only table entry to test is [0], low and high are both 0, mid will be 0 and since entry [0] is still not OK, high=mid-1 => ~0. Fix: make low,high,end "int". dmd\src\phobos\std\uni.c, line 461-463 int mid; int low; int high; (The fix was tested and works)
Comment #1 by benoit — 2006-06-18T13:53:07Z
*** This bug has been marked as a duplicate of 202 ***