[Issue 235] goto & scope: cannot goto forward into different try block level
http://d.puremagic.com/issues/show_bug.cgi?id=235 Don changed: What|Removed |Added CC||clugd...@yahoo.com.au --- Comment #9 from Don 2010-11-24 19:40:57 PST --- Starting with 1.064, the error message has changed to "cannot goto into try block". The code compiles on 2.010 and later. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5274] Impure function call inside impure function nested inside pure function
http://d.puremagic.com/issues/show_bug.cgi?id=5274 --- Comment #2 from bearophile_h...@eml.cc 2010-11-24 19:34:49 PST --- I have not expressed myself well enough, I am sorry. This bug report is a "diagnostic" one, it's not a "rejects valid". So I agree that this code needs to be refused at compile time, but is this a good message? test.d(4): Error: pure function 'foo' cannot call impure function 'putchar' foo() doesn't contain putchar(), it's bar() that calls it. I don't know what is a good error message for this situation. This is a reduced test case: void foo() {} pure void bar() { void spam() { foo(); } } void main() {} Maybe you are right, there is no much better error message to be invented here. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5274] Impure function call inside impure function nested inside pure function
http://d.puremagic.com/issues/show_bug.cgi?id=5274 Don changed: What|Removed |Added Status|NEW |RESOLVED CC||clugd...@yahoo.com.au Resolution||INVALID --- Comment #1 from Don 2010-11-24 19:06:38 PST --- (In reply to comment #0) > This D2 code is formally correct because bar() is never called: No, the code is incorrect. The error message occurs because bar() cannot be compiled. Think about it -- its mangled name must have 'pure' in it. The fact that there's no way that the function can actually be called, is irrelevant: it was marked as pure, but it violates pure. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5248] CTFE Segfault when calling a function on an enum struct
http://d.puremagic.com/issues/show_bug.cgi?id=5248 --- Comment #1 from Gareth Charnock 2010-11-24 18:46:06 PST --- Slight simplification, you don't need a main to cause this: struct LeafType { string Compile_not_ovloaded() { return "expression"; } }; struct MatrixASTNode { LeafType Right; string Compile() { return Right.Compile_not_ovloaded(); } }; enum AST = MatrixASTNode(); enum s=AST.Compile(); Makes the backtrace shorter. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5274] New: Impure function call inside impure function nested inside pure function
http://d.puremagic.com/issues/show_bug.cgi?id=5274 Summary: Impure function call inside impure function nested inside pure function Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Keywords: diagnostic Severity: minor Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-11-24 16:50:31 PST --- This D2 code is formally correct because bar() is never called: import core.stdc.stdio: putchar; pure void foo() { static void bar() { putchar('a'); } } void main() {} DMD 2.050 prints: test.d(4): Error: pure function 'foo' cannot call impure function 'putchar' Despite foo() doesn't contain calls to putchar(). Even if I modify this program, adding a call to bar() inside foo(), that strange error message doesn't change. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4172] Improve varargs
http://d.puremagic.com/issues/show_bug.cgi?id=4172 Fawzi Mohamed changed: What|Removed |Added CC||fa...@gmx.ch --- Comment #1 from Fawzi Mohamed 2010-11-24 15:24:32 PST --- The clean way to fix this (and what LDC does) is to pack all arguments (aligning them) in a stack allocated array, create the typeinfo array, and then call the function passing to it a void* to the packed array and the typeinfo array. Thus the D vararg would be equivalent to void*,TypeInfo[]. More explicitly f(...) -> f(void*,TypeInfo[]) This is slightly less efficient than C for some arguments, but is very portable, and one can skip an argument just using typeinfo information (tsize, and possibly alignment). This was the first bug I did encounter when coming to D: I did try to print a complex number and it failed because tango did not explicitly decode a complex. I did add support for some more kinds of hard coded structs to decode, but as nfxjfg says it is impossible to cover all cases on all architectures, as one should cover all possible types at compile time and decode each one with a special va_arg call. The proposed solution is relatively efficient, and portable. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4229] cast spec
http://d.puremagic.com/issues/show_bug.cgi?id=4229 --- Comment #1 from Ellery Newcomer 2010-11-24 14:20:49 PST --- surprised to find out that the last one actually does something: const(uint) i; const(uint[]) j; assert(is(typeof( cast() i) == uint)); assert(is(typeof( cast() j) == const(uint)[])); and here I was assuming it was a typo. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5271] Not constant RAND_MAX
http://d.puremagic.com/issues/show_bug.cgi?id=5271 Iain Buclaw changed: What|Removed |Added CC||ibuc...@ubuntu.com --- Comment #2 from Iain Buclaw 2010-11-24 13:04:50 PST --- Having a quick look round, it is 0x7FFF on FreeBSD and OSX too. (Hexadecimal value for 2147483647). Regards -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5271] Not constant RAND_MAX
http://d.puremagic.com/issues/show_bug.cgi?id=5271 Walter Bright changed: What|Removed |Added CC||bugzi...@digitalmars.com --- Comment #1 from Walter Bright 2010-11-24 12:35:54 PST --- On ubuntu it is 2147483647. It still must be hardcoded, as it is a compile time constant, but version'd for the different platforms. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5273] New: ref Primitives Can Be Implicitly Cast To immutable
http://d.puremagic.com/issues/show_bug.cgi?id=5273 Summary: ref Primitives Can Be Implicitly Cast To immutable Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Keywords: accepts-invalid Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: dsim...@yahoo.com --- Comment #0 from David Simcha 2010-11-24 12:20:35 PST --- The following invalid code is accepted: bool isSmall(immutable ref int num) { return num < 5; } void main() { int num; isSmall(num); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5272] New: Postblit not called on copying due to array append
http://d.puremagic.com/issues/show_bug.cgi?id=5272 Summary: Postblit not called on copying due to array append Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: druntime AssignedTo: s...@invisibleduck.org ReportedBy: dsim...@yahoo.com --- Comment #0 from David Simcha 2010-11-24 12:19:31 PST --- I found this bug by reading the code in lifetime.d, not by a test case. Struct postblits are not called when an array is copied due to an append, and they should be, since there could still be references to the original array. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5271] New: Not constant RAND_MAX
http://d.puremagic.com/issues/show_bug.cgi?id=5271 Summary: Not constant RAND_MAX Product: D Version: D2 Platform: x86 OS/Version: Linux Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bearophile_h...@eml.cc --- Comment #0 from bearophile_h...@eml.cc 2010-11-24 11:42:07 PST --- I think the std.c.stdlib.RAND_MAX (core.stdc.stdlib.RAND_MAX) value is hardcoded in Phobos, in a line of the two "stdlib.d" files: enum RAND_MAX = 32767; If this is true, then it's an error, because in other systems rand() may return other values. In particular, on an Ubuntu Linux I have seen RAND_MAX needs to be int.max instead of short.max. So this value has to change according to the situation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5270] New: Using a scope delegate allows memory corruption in safe mode
http://d.puremagic.com/issues/show_bug.cgi?id=5270 Summary: Using a scope delegate allows memory corruption in safe mode Product: D Version: D2 Platform: All OS/Version: All Status: NEW Keywords: accepts-invalid, spec Severity: major Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: bugzi...@kyllingen.net --- Comment #0 from Lars T. Kyllingstad 2010-11-24 09:04:42 PST --- The following program compiles and runs without error. Memory corruption happens in bar() because the context for the delegate stored in globalDg never gets copied to the heap, due to the 'scope' storage class being used in call(). @safe: void delegate() globalDg; void call(scope void delegate() @safe dg) { dg(); // Don't tell anyone, but I'm saving this for later ;) globalDg = dg; } void foo() { int i; void izero() { i = 0; } call(&izero); assert (i == 0); } void bar() { int x = 123; // Simply calling some function cannot possibly // do anything to x... globalDg(); // ...or can it? assert (x == 0); } void main() { foo(); bar(); } -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5265] std.array.back does not work correctly for wchar-based arrays
http://d.puremagic.com/issues/show_bug.cgi?id=5265 Andrei Alexandrescu changed: What|Removed |Added Status|NEW |ASSIGNED CC||and...@metalanguage.com AssignedTo|nob...@puremagic.com|and...@metalanguage.com -- 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
http://d.puremagic.com/issues/show_bug.cgi?id=1001 --- Comment #34 from Witold Baryluk 2010-11-24 08:22:14 PST --- (In reply to comment #30) > Okay, demangling added for Linux and OSX. I'll try to make sure that > -L--export-dynamic is added to dmd.conf on Linux for the next release. Wouldn't it be better, if it will be added by compiler itself when command line have any of -g, -gc, -debug, -cov, -profile? BTW. after adding -L--export-dynamic under Linux stacktrace display works almost perfectly. Example: $D/dmt> ./dmt s.dt std.stream.OpenException: Cannot open or create file 's.dt' ./dmt(std std.stream.StreamException.__ctor(immutable(char)[])) [0x809ccf9] ./dmt(std std.stream.StreamFileException.__ctor(immutable(char)[])) [0x80a0507] ./dmt(std std.stream.OpenException.__ctor(immutable(char)[])) [0x80a0527] ./dmt(_D3std6stream4File4openMFAyaE3std6stream8FileModeZv+0xe5) [0x80a06d9] ./dmt(_D3std6stream4File6__ctorMFAyaE3std6stream8FileModeZC3std6stream4File+0x25) [0x80a05ed] ./dmt(_D3std6stream12BufferedFile6__ctorMFAyaE3std6stream8FileModekZC3std6stream12BufferedFile+0x28) [0x80a0c9c] ./dmt(bool dmt.Convert(immutable(char)[], immutable(char)[])) [0x808a7e9] ./dmt(_Dmain+0x1ef) [0x808b323] ./dmt(extern (C) int rt.dmain2.main(int, char**)) [0x8091279] ./dmt(extern (C) int rt.dmain2.main(int, char**)) [0x80911cf] ./dmt(extern (C) int rt.dmain2.main(int, char**)) [0x80912bf] ./dmt(extern (C) int rt.dmain2.main(int, char**)) [0x80911cf] ./dmt(main+0xa7) [0x8091177] /lib/i686/cmov/libc.so.6(__libc_start_main+0xe6) [0xb7630c76] ./dmt() [0x808a431] $ I had everything compiled with -gc -L--export-dynamic including druntime and phobos. For some reasons it still do not demangle some symbols. It happens both in when compiling phobos/druntime with -release and without it. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5247] std.utf.stride() should not return 0xFF
http://d.puremagic.com/issues/show_bug.cgi?id=5247 Masahiro Nakagawa changed: What|Removed |Added Status|NEW |RESOLVED CC||repeate...@gmail.com Resolution||FIXED --- Comment #3 from Masahiro Nakagawa 2010-11-24 07:57:11 PST --- Fixed in changeset 2190. http://dsource.org/projects/phobos/changeset/2190 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2114] Incorrect example foreach readLine()
http://d.puremagic.com/issues/show_bug.cgi?id=2114 Witold Baryluk changed: What|Removed |Added CC||bary...@smp.if.uj.edu.pl --- Comment #1 from Witold Baryluk 2010-11-24 07:52:30 PST --- For reference: this bug is related to bug2081 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 2081] Foreach over Stream appears broken
http://d.puremagic.com/issues/show_bug.cgi?id=2081 Witold Baryluk changed: What|Removed |Added CC||bary...@smp.if.uj.edu.pl --- Comment #5 from Witold Baryluk 2010-11-24 07:44:01 PST --- I just hit this bug. What is worse, example on page http://digitalmars.com/d/2.0/phobos/std_stream.html#opApply do not work exactly because of this bug! -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5269] New: version(assert)
http://d.puremagic.com/issues/show_bug.cgi?id=5269 Summary: version(assert) Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: enhancement Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: dsim...@yahoo.com --- Comment #0 from David Simcha 2010-11-24 07:21:18 PST --- This is a trivial enhancement request: Could we please have a version(assert) statement kind of like version(unittest) that allows setup code for assertions to run when assertions are enabled and be compiled out when assertions are disabled? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5257] std.algorithm.count works incorrectly with UTF8 and UTF16 strings
http://d.puremagic.com/issues/show_bug.cgi?id=5257 Masahiro Nakagawa changed: What|Removed |Added AssignedTo|and...@metalanguage.com |repeate...@gmail.com --- Comment #3 from Masahiro Nakagawa 2010-11-24 07:18:51 PST --- Created an attachment (id=831) Patch for this issue. I wrote a simple patch. This patch decodes each char types to dchar and passes predication. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5268] New: Outdated windows GUI sample in Samples folder
http://d.puremagic.com/issues/show_bug.cgi?id=5268 Summary: Outdated windows GUI sample in Samples folder Product: D Version: D2 Platform: Other OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: andrej.mitrov...@gmail.com --- Comment #0 from Andrej Mitrovic 2010-11-24 06:32:47 PST --- winsamp.d in the DMD\DMD2\Samples\d folder used an outdated WinMain template. I'm providing a fix: http://dl.dropbox.com/u/9218759/winsamp.zip -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5267] New: phobos' linux.mak do not build std/exception.d
http://d.puremagic.com/issues/show_bug.cgi?id=5267 Summary: phobos' linux.mak do not build std/exception.d Product: D Version: D2 Platform: x86 OS/Version: Linux Status: NEW Severity: major Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: bary...@smp.if.uj.edu.pl --- Comment #0 from Witold Baryluk 2010-11-24 06:26:33 PST --- I was rebuilding phobos' included in dmd2.050.zip, on Linux, becuase i wanted to have debuging symbols (-gc -L--export-dynamic) working well in gdb. I discovered that linux.mak does not include exception module in variable STD_MODULES. Phobos build correctly, but when linking executables linker shows undefined references to std.exception.* posix.mak have STD_MODULES with exception added. Adding exception to STD_MODULES in src/phobos/linux.mak resolves problem. Thanks. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 4590] Spec incorrectly describes array appending and memory stomping
http://d.puremagic.com/issues/show_bug.cgi?id=4590 Steven Schveighoffer changed: What|Removed |Added Status|NEW |RESOLVED Resolution||FIXED --- Comment #1 from Steven Schveighoffer 2010-11-24 05:55:47 PST --- Not sure why I didn't mark this as fixed... Fixed in 2.048 -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5266] New: Windows sample code different on website and in samples directory
http://d.puremagic.com/issues/show_bug.cgi?id=5266 Summary: Windows sample code different on website and in samples directory Product: D Version: D2 Platform: x86 OS/Version: Windows Status: NEW Severity: normal Priority: P2 Component: DMD AssignedTo: nob...@puremagic.com ReportedBy: simen.kja...@gmail.com --- Comment #0 from Simen Kjaeraas 2010-11-24 05:28:23 PST --- WinMain in $DMD\samples\d\winsamp.d follows an old pattern for how to write a WinMain, thus not running static constructors. More correct code is on the website, though it also has issues (see http://d.puremagic.com/issues/show_bug.cgi?id=5261) -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5265] New: std.array.back does not work correctly for wchar-based arrays
http://d.puremagic.com/issues/show_bug.cgi?id=5265 Summary: std.array.back does not work correctly for wchar-based arrays Product: D Version: D2 Platform: All OS/Version: All Status: NEW Severity: normal Priority: P2 Component: Phobos AssignedTo: nob...@puremagic.com ReportedBy: schvei...@yahoo.com --- Comment #0 from Steven Schveighoffer 2010-11-24 05:11:09 PST --- In std.array, back() is the same for both char[] based and wchar[] based arrays, but wchar[] based arrays are encoded differently than char[] based ones. It appears the back() function works in most cases, but fails on a few. Here is an example (thank you to Stephan): import std.array; import std.conv; void main() { dchar c = cast(dchar) 0x1; auto ws = to!wstring(c); assert(ws.length == 2);// decoded as surrogate pair assert(ws.back == c); // fails with decoding error } This should be added as a unit test, and back(wstring) should get its own implementation. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5264] x86_64 changes for druntime 2
http://d.puremagic.com/issues/show_bug.cgi?id=5264 --- Comment #3 from Brad Roberts 2010-11-24 02:32:54 PST --- for #3, call cleanup code in cod1.c funccall(): 2936 if (tym1 == TYhfunc) 2937 { // Hidden parameter is popped off by the callee 2938 c = genadjesp(c, -4); 2939 stackpush -= 4; This code isn't aware of the 32 vs 64 bit calling convention differences yet? -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---
[Issue 5264] x86_64 changes for druntime 2
http://d.puremagic.com/issues/show_bug.cgi?id=5264 --- Comment #2 from Brad Roberts 2010-11-24 01:35:00 PST --- ok, debugging #3. There's actually a couple of different assert locations, though I suspect they're all related. If the fix for this reduction doesn't solve all of them, I'll re-reduce the next one. = module hrm; struct BlkInfo { size_t size; } extern (C) BlkInfo gc_qalloc(size_t sz, uint ba); void __setArrayAllocLength(ref BlkInfo info) { if (info.size) {} } extern (C) void foo() { BlkInfo info = gc_qalloc(0, 0); __setArrayAllocLength(info); } == $ ../dmd-trunk/src/dmd -c -m64 hrm.d Internal error: backend/cod1.c 2554 Building in 32 bit mode (without -m64) works just fine. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email --- You are receiving this mail because: ---