digitalmars.D.bugs - [Issue 207] New: isUniAlpha fails for values < 'A'
- d-bugmail puremagic.com (29/29) Jun 18 2006 http://d.puremagic.com/issues/show_bug.cgi?id=207
- Lionello Lunesu (1/1) Jun 18 2006 (it includes the fix, by the way)
- d-bugmail puremagic.com (9/9) Jun 18 2006 http://d.puremagic.com/issues/show_bug.cgi?id=207
- Lionello Lunesu (1/1) Jun 18 2006 ...whoops
http://d.puremagic.com/issues/show_bug.cgi?id=207
Summary: isUniAlpha fails for values < 'A'
Product: D
Version: 0.160
Platform: PC
OS/Version: Windows
Status: NEW
Severity: normal
Priority: P2
Component: Phobos
AssignedTo: bugzilla digitalmars.com
ReportedBy: lio lunesu.com
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)
--
Jun 18 2006
(it includes the fix, by the way)
Jun 18 2006
http://d.puremagic.com/issues/show_bug.cgi?id=207
benoit tionex.de changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|NEW |RESOLVED
Resolution| |DUPLICATE
*** This bug has been marked as a duplicate of 202 ***
--
Jun 18 2006









"Lionello Lunesu" <lionello lunesu.remove.com> 