[Issue 2063] std.xml access violation for nested, closed tags
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Sat May 3 09:55:35 PDT 2008
http://d.puremagic.com/issues/show_bug.cgi?id=2063
------- Comment #4 from gide at nwawudu.com 2008-05-03 11:55 -------
> Question: Is this in debug mode or release mode?
Happens in both, the following code highlights the issue.
[CODE]
import std.stdio;
import std.file;
import std.xml;
int main(){
try {
string s1 = cast(string)std.file.read("widget.xml");
string s2 = q"[<?xml version="1.0"?><widget>]";
// print chars, s1 and s2 are the equal
writeln(s1.length == s2.length);
foreach (int i, char c; s1) {
writeln(s1[i], ": ", s1[i] == s2[i]);
}
alias s1 testStr; // s1 Access Violation
//alias s2 testStr; // As expected CheckException
std.xml.check(testStr);
auto doc = new std.xml.Document(testStr);
writefln(doc);
return 0;
} catch (CheckException e) {
writeln("XML: ", e.toString());
} catch (object.Exception e) {
writeln("ERROR: ", e.toString());
}
return 1;
}
[/CODE]
--
More information about the Digitalmars-d-bugs
mailing list