digitalmars.D.bugs - dmd 125 bug? compiles and seg faults...
- clayasaurus <clayasaurus gmail.com> May 23 2005
- "Andrew Fedoniouk" <news terrainformatica.com> May 23 2005
- "Walter" <newshound digitalmars.com> May 23 2005
- Roberto Mariottini <Roberto_member pathlink.com> May 24 2005
- "Walter" <newshound digitalmars.com> May 24 2005
- David Medlock <noone nowhere.com> May 24 2005
- "Walter" <newshound digitalmars.com> May 25 2005
- "Andrew Fedoniouk" <news terrainformatica.com> May 25 2005
- John Reimer <brk_6502 yahoo.com> May 25 2005
- "Unknown W. Brackets" <unknown simplemachines.org> May 25 2005
- Dave <Dave_member pathlink.com> May 27 2005
is seg faulting the desired behavior of this code?
-------------------------------------------------------------------
import std.stdio;
int main()
{
Two thy = new Two;
thy.print();
return 0;
}
class One
{
void print()
{
writefln("Hello");
}
}
class Two : One
{
void print()
{
One:print();
writefln("There");
}
}
-------------------------------------------------------------------
I wrote this while trying to rediscover inheritance. Anyway, I found
super.print() works.
May 23 2005
Yours:
void print()
{
print();
}
will produce "Stack overflow".
May 23 2005
"clayasaurus" <clayasaurus gmail.com> wrote in message news:d6tven$2g4r$1 digitaldaemon.com...import std.stdio; int main() { Two thy = new Two; thy.print(); return 0; } class One { void print() { writefln("Hello"); } } class Two : One { void print() { One:print();
Replacing the ':' with a '.' and it exhibits the behavior you're looking for. The One:print(); is parsed as One being a label, then the print() recursively calls itself till the stack overflows.writefln("There"); } }
May 23 2005
In article <d6uir1$30uc$1 digitaldaemon.com>, Walter says...
void print() { One:print();
Replacing the ':' with a '.' and it exhibits the behavior you're looking for. The One:print(); is parsed as One being a label, then the print() recursively calls itself till the stack overflows.
Time for an Obfuscated D contest! ;-) Ciao
May 24 2005
"Roberto Mariottini" <Roberto_member pathlink.com> wrote in message news:d6ujrt$s0$1 digitaldaemon.com...Time for an Obfuscated D contest! ;-)
Ouch!
May 24 2005
Roberto Mariottini wrote:In article <d6uir1$30uc$1 digitaldaemon.com>, Walter says... [...]void print() { One:print();
Replacing the ':' with a '.' and it exhibits the behavior you're looking for. The One:print(); is parsed as One being a label, then the print() recursively calls itself till the stack overflows.
Time for an Obfuscated D contest! ;-) Ciao
-DavidM
May 24 2005
"David Medlock" <noone nowhere.com> wrote in message news:d70at4$2hvq$1 digitaldaemon.com...Roberto Mariottini wrote:In article <d6uir1$30uc$1 digitaldaemon.com>, Walter says...void print() { One:print();
Replacing the ':' with a '.' and it exhibits the behavior you're looking for. The One:print(); is parsed as One being a label, then the print() recursively calls itself till the stack overflows.
Time for an Obfuscated D contest! ;-)
Long ago, the C'ith Lord mastered the dark secrets of the goto and the pointer to gain unprecedented levels of power, using it to betray and slaughter the Javi Knights. A dark age of buffer overflows and gp faults ensued, and many systems were ravaged by virus attacks. But from the fatal loins of the C'ith Lord spawned a new hope, Duke Arraywalker, with power greater than even the C'ith could imagine. But Duke is young and unproven. Will he apprentice with the exiled Javi? Will he learn the unix ways of the Source? Will he prevail in the coming battle with the C'ith Lord? Or will he be seduced by the dark side of the goto and the pointer? Stay tuned!
May 25 2005
Walter wrote:Long ago, the C'ith Lord mastered the dark secrets of the goto and the pointer to gain unprecedented levels of power, using it to betray and slaughter the Javi Knights. A dark age of buffer overflows and gp faults ensued, and many systems were ravaged by virus attacks. But from the fatal loins of the C'ith Lord spawned a new hope, Duke Arraywalker, with power greater than even the C'ith could imagine. But Duke is young and unproven. Will he apprentice with the exiled Javi? Will he learn the unix ways of the Source? Will he prevail in the coming battle with the C'ith Lord? Or will he be seduced by the dark side of the goto and the pointer? Stay tuned!
That was funny! And to think compiler writing became your chosen profession... ;-) -JJR
May 25 2005
LOL. -[Unknown]Long ago, the C'ith Lord mastered the dark secrets of the goto and the pointer to gain unprecedented levels of power, using it to betray and slaughter the Javi Knights. A dark age of buffer overflows and gp faults ensued, and many systems were ravaged by virus attacks. But from the fatal loins of the C'ith Lord spawned a new hope, Duke Arraywalker, with power greater than even the C'ith could imagine. But Duke is young and unproven. Will he apprentice with the exiled Javi? Will he learn the unix ways of the Source? Will he prevail in the coming battle with the C'ith Lord? Or will he be seduced by the dark side of the goto and the pointer? Stay tuned!
May 25 2005
In article <d7287c$30af$1 digitaldaemon.com>, Walter says..."David Medlock" <noone nowhere.com> wrote in message news:d70at4$2hvq$1 digitaldaemon.com...Roberto Mariottini wrote:In article <d6uir1$30uc$1 digitaldaemon.com>, Walter says...void print() { One:print();
Replacing the ':' with a '.' and it exhibits the behavior you're looking for. The One:print(); is parsed as One being a label, then the print() recursively calls itself till the stack overflows.
Time for an Obfuscated D contest! ;-)
Long ago, the C'ith Lord mastered the dark secrets of the goto and the pointer to gain unprecedented levels of power, using it to betray and slaughter the Javi Knights. A dark age of buffer overflows and gp faults ensued, and many systems were ravaged by virus attacks. But from the fatal loins of the C'ith Lord spawned a new hope, Duke Arraywalker, with power greater than even the C'ith could imagine. But Duke is young and unproven. Will he apprentice with the exiled Javi? Will he learn the unix ways of the Source? Will he prevail in the coming battle with the C'ith Lord? Or will he be seduced by the dark side of the goto and the pointer? Stay tuned!
LOL. This one is destined for my archive drive <g>
May 27 2005









"Andrew Fedoniouk" <news terrainformatica.com> 