[Issue 4252] New: [CTFE]: No array bounds checking in assignment to char[] array

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4252

   Summary: [CTFE]: No array bounds checking in assignment to
char[] array
   Product: D
   Version: 2.041
  Platform: Other
OS/Version: Windows
Status: NEW
  Keywords: rejects-valid
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: clugd...@yahoo.com.au


--- Comment #0 from Don clugd...@yahoo.com.au 2010-05-30 08:05:01 PDT ---
This code shouldn't compile, due to the array bounds error. But instead,
compiler memory corruption occurs.

int bug4252()
{
char [] s = abc.dup;
s[5] = 'd';
return 3;
}
static assert(bug4252());

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


[Issue 4239] Mixed tuple comparison

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4239


nfx...@gmail.com changed:

   What|Removed |Added

 Depends on||3279


--- Comment #3 from nfx...@gmail.com 2010-05-30 08:36:20 PDT ---
Bug 3279 is the reason why the obvious idea to implement this fails.

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


[Issue 4253] New: opCall() not called in initialized struct

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4253

   Summary: opCall() not called in initialized struct
   Product: D
   Version: future
  Platform: x86
OS/Version: Windows
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: bearophile_h...@eml.cc


--- Comment #0 from bearophile_h...@eml.cc 2010-05-30 09:27:07 PDT ---
This is a small C++ program that compiles:

templatetypename T struct Foo {
Foo(T x) {}
templatetypename U void operator()(U y) {}
};
int main() {
Fooint foo(1);
foo(1.5);
}


I think this is an equivalent D2 program:

struct Foo(T) {
this(T x) {}
void opCall(U)(U y) {}
}
void main() {
auto foo = Foo!int(1);
foo(1.5); // line 7
}


But DMD V. 2.046 prints:
temp.d(7): Error: constructor temp.Foo!(int).Foo.this (int x) is not callable
using argument types (double)
temp.d(7): Error: cannot implicitly convert expression (1.5) of type double to
int

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


[Issue 4253] opCall() not called in initialized struct

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4253



--- Comment #1 from bearophile_h...@eml.cc 2010-05-30 09:29:40 PDT ---
A simpler test case:

struct Foo {
this(int x) {}
void opCall(double y) {}
}
void main() {
Foo foo = Foo(1);
foo(1.5);
}

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


[Issue 4250] std.regex does not support character sets other than unicode

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4250


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com
   Severity|normal  |enhancement


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
11:02:48 PDT ---
It's not designed to do anything but UTF, so marked as an enhancement request.

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


[Issue 2127] inliner turns struct return *this from by-value into by-ref

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=2127


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #3 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
11:03:31 PDT ---
http://www.dsource.org/projects/dmd/changeset/505

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


[Issue 3323] Segfault or ICE(e2ir.c) using struct with destructor almost anywhere

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3323


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
11:04:51 PDT ---
http://www.dsource.org/projects/dmd/changeset/506

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


[Issue 3934] Some untidy attributes

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3934


Stewart Gordon s...@iname.com changed:

   What|Removed |Added

 CC||s...@iname.com


--- Comment #2 from Stewart Gordon s...@iname.com 2010-05-30 14:21:25 PDT ---
This seems to be partly a duplicate of issue 3118.

Without a clear spec on the matter, it's hard to decide which of these it's a
bug that the compiler accepts, but certainly foo3 and foo4 AISI.

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


[Issue 3516] Destructor not called on temporaries

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=3516


Brad Roberts bra...@puremagic.com changed:

   What|Removed |Added

 CC||bra...@puremagic.com


--- Comment #3 from Brad Roberts bra...@puremagic.com 2010-05-30 15:59:09 PDT 
---
Reduced test case:
extern(C) int printf(const char*, ...);

int numctor, numdtor;

struct Tid
{
this(int i) { ++numctor; }
~this() { ++numdtor; }
}

Tid f() { return Tid(1); }

// This temporary is destroyed
void test1() { Tid tid = f(); }

// This (invisible) temporary is never destroyed
void test2() { f(); }

void main()
{
numctor = numdtor = 0;
test1();
printf(numctor = %d, numdtor = %d\n, numctor, numdtor);
assert(numctor == 1);
assert(numdtor == 1);

numctor = numdtor = 0;
test2();
printf(numctor = %d, numdtor = %d\n, numctor, numdtor);
assert(numctor == 1);
assert(numdtor == 1);
}

Current results:
numctor = 1, numdtor = 1
numctor = 1, numdtor = 0
core.exception.asserter...@bug3516(31): Assertion failure

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


[Issue 4078] [CTFE] Failed return of dynamic array item

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4078


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #2 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
16:30:17 PDT ---
http://www.dsource.org/projects/dmd/changeset/507

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


[Issue 4054] ICE(eh.c) line 49

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4054


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 CC||bugzi...@digitalmars.com


--- Comment #4 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
16:30:59 PDT ---
http://www.dsource.org/projects/dmd/changeset/507

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


[Issue 4252] [CTFE]: No array bounds checking in assignment to char[] array

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4252


Walter Bright bugzi...@digitalmars.com changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||bugzi...@digitalmars.com
 Resolution||FIXED


--- Comment #1 from Walter Bright bugzi...@digitalmars.com 2010-05-30 
16:31:20 PDT ---
http://www.dsource.org/projects/dmd/changeset/507

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


[Issue 4254] New: addMod assertion failure

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4254

   Summary: addMod assertion failure
   Product: D
   Version: unspecified
  Platform: Other
OS/Version: Linux
Status: NEW
  Severity: normal
  Priority: P2
 Component: DMD
AssignedTo: nob...@puremagic.com
ReportedBy: ellery-newco...@utulsa.edu


--- Comment #0 from Ellery Newcomer ellery-newco...@utulsa.edu 2010-05-30 
17:02:55 PDT ---
The code:

void bub(const inout int other) {}
void main() {
bub(1);
}

The result:

dmd: mtype.c:1155: Type* Type::addMod(unsigned int): Assertion `0' failed.
/home/ellery/bin/dmd: line 3: 25241 Aborted (core dumped)
/home/ellery/Downloads/dmd2046/linux/bin/dmd $*

dmd  2.046

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


[Issue 4230] version(unittest)

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4230


Leandro Lucarella llu...@gmail.com changed:

   What|Removed |Added

 CC||llu...@gmail.com


--- Comment #3 from Leandro Lucarella llu...@gmail.com 2010-05-30 17:19:58 
PDT ---
BTW, unittest is mentioned in the documentation for D1 but it doesn't work:

$ cat u.d
version (unittest) {}
$ dmd -c u.d 
u.d(1): identifier or integer expected, not unittest

I don't know if the documentation for D1 is wrong or the compiler is buggy.

http://www.digitalmars.com/d/1.0/unittest.html

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


[Issue 4230] version(unittest)

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4230



--- Comment #4 from Leandro Lucarella llu...@gmail.com 2010-05-30 17:24:15 
PDT ---
And Ellery Newcomer is right, for both D1 and D2 the specs says:

VersionCondition:
version ( Integer )
version ( Identifier )

But unittest is not either an Integer or an Identifier (is a Keyword).

http://www.digitalmars.com/d/1.0/version.html
http://www.digitalmars.com/d/1.0/lex.html#keyword

http://www.digitalmars.com/d/2.0/version.html
http://www.digitalmars.com/d/2.0/lex.html#keyword

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


[Issue 4252] [CTFE]: No array bounds checking in assignment to char[] array

2010-05-30 Thread d-bugmail
http://d.puremagic.com/issues/show_bug.cgi?id=4252


BCS shro8...@vandals.uidaho.edu changed:

   What|Removed |Added

 CC||shro8...@vandals.uidaho.edu


--- Comment #2 from BCS shro8...@vandals.uidaho.edu 2010-05-30 17:47:12 PDT 
---
The revision that fixed this also fixed a missing line number bug. Looking at
the source, it did so by calling a error function with a Loc value rather than
without it. My question is why the original function even exists? When would
the compiler ever need to dump an error message and not have a line number to
attach to it?

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