[Issue 3453] Linking order affects proper execution (Mac OSX only)

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3453



--- Comment #7 from Walter Bright  2010-02-03 
22:39:03 PST ---
changeset 363

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3767] New: All programs compiled with DMD 2.040 on Mac OS X 10.5.8 are Segmentation fault.

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3767

   Summary: All programs compiled with DMD 2.040 on Mac OS X
10.5.8 are Segmentation fault.
   Product: D
   Version: 2.040
  Platform: x86
OS/Version: Mac OS X
Status: NEW
  Severity: critical
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: kamab...@gmail.com


--- Comment #0 from kamab...@gmail.com 2010-02-03 20:18:06 PST ---
Crash on static ctor?

$ cat main.d
void main(){}
$ dmd main.d
$ ./main
Segmentation fault
$ cat crash.d 
import std.c.stdio;

shared static this ()  { fprintf(stderr,"shared static this ()\n"); }
shared static ~this () { fprintf(stderr,"shared static ~this ()\n");}

static this () { fprintf(stderr,"static this ()\n"); }
static ~this () { fprintf(stderr,"static ~this ()\n"); }

void main(){ fprintf(stderr,"ok\n"); }
$ dmd crash.d
$ ./crash
shared static this ()
Segmentation fault
$

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3763] std.stdio.readlnImpl absurdly inefficient and overflows stack

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3763



--- Comment #4 from Andrei Alexandrescu  2010-02-03 
17:37:42 PST ---
Love the summary, hate the code.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3766] New: Pointers to pure, nothrow functions be subtypes of regular functions

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3766

   Summary: Pointers to pure, nothrow functions be subtypes of
regular functions
   Product: D
   Version: 2.040
  Platform: Other
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: dsim...@yahoo.com


--- Comment #0 from David Simcha  2010-02-03 13:56:10 PST ---
void nothrowStuff() nothrow {}
void pureStuff() pure {}
void stuff() {}

auto funcPtr = (0 == 0) ? &stuff : ¬hrowStuff;
auto funcPtr2 = (0 == 0) ? &stuff : &pureStuff;

test.d(5): Error: incompatible types for ((& stuff) ? (& nothrowStuff)): 'void
function()' and 'void function() nothrow'
test.d(6): Error: incompatible types for ((& stuff) ? (& pureStuff)): 'void
function()' and 'void function() pure'

void function() pure and void function() nothrow should be considered subtypes
of void function().  A void function() pure or a void function() nothrow simply
provides an extra guarantee not present for void function() and thus can be
substituted in any context for a void function().

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3765] New: User defined types contains few user defined types

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3765

   Summary: User defined types contains few user defined types
   Product: D
   Version: 2.040
  Platform: All
OS/Version: All
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: repeate...@gmail.com


--- Comment #0 from Masahiro Nakagawa  2010-02-03 
05:54:55 PST ---
NOTE: This report is minimum sample. Original code is here
http://dimerp.web.fc2.com/dx01.d 

struct S1  // class S1 and union S1 too
{
union { S2 a; S2 b; }  // struct too
union { S2 c; }
}

struct S2 { }  // class S2: OK, union S2: crash,

DMD crashed when I tried to compile this code. But following codes, changed S1
members, succeeds. 

struct S1
{
union { S2 a; }
union { S2 b; }
union { S2 c; }
}

or

struct S1
{
union { S2 a; S2 b; S2 c; }
}

Of course. Compiling succeeds if S2 defines before S1.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 1499] __trais: iterating over __traits(allMembers, ...) with extern attributes does not compile

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1499


Hoenir  changed:

   What|Removed |Added

 CC||mrmoc...@gmx.de


--- Comment #1 from Hoenir  2010-02-03 05:24:30 PST ---
compiles with r360 now that allMembers returns a tuple rather than an array.
BUT it crashes when the compiled program is run.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 1001] print stack trace (in debug mode) when program die

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=1001



--- Comment #7 from Brad Roberts  2010-02-03 01:19:34 PST 
---
Created an attachment (id=560)
first pass patch to add stack tracing for exceptions on linux

It's dumping filename (always the test binary name right now) and address, but
not function name for some reason.. at least on my debian amd/64 box.  I'm not
sure yet why it's failing to find the symbols right now.  I need to pull the
code over into a C app to make sure it works there.  That'd at least help
narrow down where the problem lies.

Current output:
$ ./obj/posix/debug/unittest.brad
object.Exception: blah

./obj/posix/debug/unittest.brad [0x804b684]
./obj/posix/debug/unittest.brad [0x804b65c]
./obj/posix/debug/unittest.brad [0x804ab0b]
./obj/posix/debug/unittest.brad [0x804a8f0]
./obj/posix/debug/unittest.brad [0x804ab27]
./obj/posix/debug/unittest.brad [0x80491de]
./obj/posix/debug/unittest.brad [0x80491f0]
./obj/posix/debug/unittest.brad [0x804b93c]
./obj/posix/debug/unittest.brad [0x804b745]
./obj/posix/debug/unittest.brad [0x804b97e]
./obj/posix/debug/unittest.brad [0x804b745]
./obj/posix/debug/unittest.brad [0x804b603]
/lib32/libc.so.6(__libc_start_main+0xe6) [0xf7e02b46]
./obj/posix/debug/unittest.brad [0x8049101]

test code:
public import std.c.stdio;

void foo()
{
throw new Exception("blah");
}

int main(char[][] args)
{   
foo();
printf("Success!\n");
return 0;
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---


[Issue 3500] super behaves differently with -inline

2010-02-03 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3500


Don  changed:

   What|Removed |Added

   Keywords||patch
Version|2.035   |1.00
Summary|Program behaves differently |super behaves differently
   |with -inline|with -inline


--- Comment #3 from Don  2010-02-03 00:19:21 PST ---
The thing that isn't working correctly is this line from the 'Expressions' page
in the spec: "If a member function is called with an explicit reference to
super, a non-virtual call is made." This bug applies to D1 as well (DMD1.00
fails).

Cause: direct calls are normally implemented in e2ir.c. If CallExp::toElem()
finds TOKsuper, it makes it a non-virtual call. But the direct call is a little
bit of a hack (there's a "//BUG: fix" comment in FuncExp::toElem()).

inline.c, SuperExp::doInline() changes it from 'super' to a variable, so e2ir
can't find it.
This patch disables inlining for direct 'super' calls. Allowing them to be
inlined would be a quite difficult, I think.


Index: inline.c
===
--- inline.c(revision 362)
+++ inline.c(working copy)
@@ -275,6 +275,10 @@

 int CallExp::inlineCost(InlineCostState *ics)
 {
+// Bugzilla 3500: super.func() calls must be devirtualized, and the
inliner
+// can't handle that at present.
+if (e1->op == TOKdotvar && ((DotVarExp *)e1)->e1->op == TOKsuper)
+return COST_MAX;
 return 1 + e1->inlineCost(ics) + arrayInlineCost(ics, arguments);
 }
-

Test case without any imports: 

class A {
void x() {  }
}

class B : A {
override void x() {
assert(0);
}
final void do_x() {
super.x();
}
}

void main() {
B b = new B();
b.do_x();
}


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
--- You are receiving this mail because: ---