strange seg-v on reclusive call
BCS
ao at pathlink.com
Mon Sep 17 22:50:09 PDT 2007
This looks to me like a bug but I could be wrong.
private import std.stdio;
void Part(Rule[] inSet)
{
scope(failure) writef("===========\n");
{ // dorp this blobk and things work
Build!(Rule) tmp;
insertUnUsed: foreach(r; inSet)
if(r.users.length == 0) // drop this line and it runs
{
}
}
F( [new Rule, null, null, null, null]); // this works
scope(failure) writef("+++++++++++++++\n");
Part([new Rule, null, null, null, null]); // this segv's
scope(failure) writef("----------\n");
}
void F(Rule[] r){}
class Rule { Rule[] users; }
alias void function(int) sighandler_t;
extern (C) sighandler_t signal(int signum, sighandler_t handler);
void main()
{
// convert sigsegv to excption
signal(11,function void(int i){throw new Error("SEGV");});
Part([new Rule()]);
}
struct Build(T)
{
static const int step = 5;
T[] a;
int at = 0;
void Insert(T t)
{
if(a.length <= at)
a.length = at + step;
a[at++] = t;
}
}
More information about the Digitalmars-d-bugs
mailing list