[Issue 8563] New: Exception segfault
d-bugmail at puremagic.com
d-bugmail at puremagic.com
Mon Aug 20 03:12:43 PDT 2012
http://d.puremagic.com/issues/show_bug.cgi?id=8563
Summary: Exception segfault
Product: D
Version: D2
Platform: x86_64
OS/Version: All
Status: NEW
Severity: critical
Priority: P2
Component: DMD
AssignedTo: nobody at puremagic.com
ReportedBy: daniel350 at bigpond.com
--- Comment #0 from Daniel Cousens <daniel350 at bigpond.com> 2012-08-20 03:12:35 PDT ---
http://dpaste.dzfl.pl/08d60e83
import std.exception : assertThrown;
import std.file : dirEntries, SpanMode;
// segfault does not occur with -O command line argument (exception is thrown
as expected with -O)
void main() {
assertThrown(dirEntries("test", SpanMode.breadth)); // assert does not
fail, as expected (ie, exception was thrown)
func("test");
}
void func(string suicide_variable) { // must be in a seperate function
auto ax = suicide_variable; // uncomment this for a segfault in the
following statement
// not clear as to why, can't yet reproduce
with other unpredictable exceptions (AFAIK)
foreach(s; dirEntries("test", SpanMode.breadth)) {} // exception is
expected, not a segfault
}
----------
I tried to produce this behaviour for other functions (ie, without the
dirEntries call), but I could not get at it; but this is all still very much
undefined behaviour.
--
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
More information about the Digitalmars-d-bugs
mailing list