[Issue 14037] New: Problem with BigInt and std.functional.memoize
https://issues.dlang.org/show_bug.cgi?id=14037 Issue ID: 14037 Summary: Problem with BigInt and std.functional.memoize Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: regression Priority: P1 Component: Phobos Assignee: nob...@puremagic.com Reporter: bearophile_h...@eml.cc This seems a regression. Now std.functional.memoize has problems with functions that return a BigInt: import std.bigint: BigInt; import std.functional: memoize; uint fibonacci1(uint n) { alias mFib = memoize!fibonacci1; // OK if (n 2) return 1; else return mFib(n - 1) + mFib(n - 2); } BigInt fibonacci2(uint n) { alias mFib = memoize!fibonacci2; // Error if (n 2) return BigInt(1); else return mFib(n - 1) + mFib(n - 2); } void main() {} dmd 2.067alpha gives: ...\dmd2\src\phobos\std\functional.d(991,9): Error: return expression expected test.d(13,18): Error: template instance std.functional.memoize!(fibonacci2) error instantiating I have seen that the problem can be fixed changing memoize, from this: template memoize(alias fun) { // alias Args = ParameterTypeTuple!fun; // Bugzilla 13580 ReturnType!fun memoize(ParameterTypeTuple!fun args) { alias Args = ParameterTypeTuple!fun; import std.typecons : Tuple; static ReturnType!fun[Tuple!Args] memo; auto t = Tuple!Args(args); if (auto p = t in memo) return *p; return memo[t] = fun(args); } } To this: template memoize(alias fun) { // alias Args = ParameterTypeTuple!fun; // Bugzilla 13580 ReturnType!fun memoize(ParameterTypeTuple!fun args) { alias Args = ParameterTypeTuple!fun; import std.typecons : Tuple; static ReturnType!fun[Tuple!Args] memo; auto t = Tuple!Args(args); if (auto p = t in memo) return *p; auto result = fun(args); memo[t] = result; return result; } } But it looks like a problem of BigInt: void main() { import std.bigint: BigInt; int[int] aa1; int r1 = aa2[1] = 1; // OK BigInt[int] aa2; BigInt r2 = aa2[1] = BigInt(1); // Error } Gives: test.d(4,14): Error: undefined identifier aa2, did you mean variable aa1? test.d(6,24): Error: expression BigInt __aaval1426 = __aaval1426 = BigInt , __aaval1426.this(1); , 1 in aa2 ? aa2[1].opAssign(__aaval1426) : cast(void)(aa2[1] = __aaval1426) is void and has no value So perhaps fixing BigInt suffices. --
[Issue 9889] Incorrect rounding on floating value formatting
https://issues.dlang.org/show_bug.cgi?id=9889 --- Comment #4 from Andrei Alexandrescu and...@erdani.com --- Thanks @yebblies! --
[Issue 13806] std.bitmanip.BitArray -- use of methods named init() messes up templates
https://issues.dlang.org/show_bug.cgi?id=13806 --- Comment #5 from hst...@quickfur.ath.cx --- Are there any other instances of init abuse in Phobos, or can we close this now? --
[Issue 9495] Win64 vararg issue when first argument is 8 byte
https://issues.dlang.org/show_bug.cgi?id=9495 --- Comment #4 from Benjamin Thaut c...@benjamin-thaut.de --- (In reply to yebblies from comment #3) This bug still exists for va_start. Repo case? --
[Issue 13806] std.bitmanip.BitArray -- use of methods named init() messes up templates
https://issues.dlang.org/show_bug.cgi?id=13806 --- Comment #4 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/588c76c19b2619361f37084ec4bcaa95f7f03417 Merge pull request #2854 from quickfur/bitarray_init Issue 13806: BitArray should not define member function called init() --
[Issue 14024] [CTFE] unstable postblit/destructor call order on static array assignment
https://issues.dlang.org/show_bug.cgi?id=14024 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #4 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4332 --
[Issue 14038] [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #3 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4334 --
[Issue 2040] Add codepage handling to core library
https://issues.dlang.org/show_bug.cgi?id=2040 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #3 from AndyC a...@squeakycode.net --- Recommend closing this. Its very old, there is no bug reported, there is no sample code, not very specific. --
[Issue 14024] [CTFE] unstable postblit/destructor call order on static array assignment
https://issues.dlang.org/show_bug.cgi?id=14024 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords|pull, wrong-code|CTFE Status|RESOLVED|REOPENED Component|druntime|DMD Resolution|FIXED |--- Summary|unstable|[CTFE] unstable |postblit/destructor call|postblit/destructor call |order on static array |order on static array |assignment |assignment --- Comment #3 from Kenji Hara k.hara...@gmail.com --- Reopen to fix CTFE behavior. --
[Issue 14036] New: Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError
https://issues.dlang.org/show_bug.cgi?id=14036 Issue ID: 14036 Summary: Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: critical Priority: P1 Component: druntime Assignee: nob...@puremagic.com Reporter: thecybersha...@gmail.com We should not attempt to throw FinalizeError when an InvalidMemoryOperationError is thrown in the destructor. This will only throw a second InvalidMemoryOperationError. Ideally, we should not catch it at all, so it is possible to see the stack trace of the destructor which caused the InvalidMemoryOperationError. --
[Issue 9889] Incorrect rounding on floating value formatting
https://issues.dlang.org/show_bug.cgi?id=9889 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED CC||yebbl...@gmail.com Resolution|FIXED |--- OS|Linux |Windows --- Comment #3 from yebblies yebbl...@gmail.com --- As the original comment states, this is specific to snn.lib (digital mars' c runtime) and therefore win32. --
[Issue 14025] unittests for memoize fail intermittently
https://issues.dlang.org/show_bug.cgi?id=14025 --- Comment #2 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/a5b1f5bcaa15ee34c731487f601391a759bf5963 Merge pull request #2901 from rainers/issue14025 fix Issue 14025 - unittests for memoize fail intermittently --
[Issue 14038] New: [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 Issue ID: 14038 Summary: [REG2.067a] Non-mutable AA initialization segfaults in runtime Product: D Version: D2 Hardware: All OS: All Status: NEW Keywords: wrong-code Severity: regression Priority: P1 Component: DMD Assignee: nob...@puremagic.com Reporter: k.hara...@gmail.com From: http://forum.dlang.org/thread/vtenbjmktplcxxmby...@forum.dlang.org With git-head, this code segfaults in runtime. static immutable words = [ `zero`, `one`, `two` ]; static immutable ubyte[string] wordsAA; static this() { foreach (ubyte i, e; words) { wordsAA[e] = i; } } The regression had introduced by the combination of: https://github.com/D-Programming-Language/dmd/pull/4159 https://github.com/D-Programming-Language/druntime/pull/1037 The core issue is in dmd e2ir.c around lien 4570. void visit(IndexExp *ie) { ... Type *t1 = ie-e1-type-toBasetype(); if (t1-ty == Taarray) { // set to: // *aaGetY(aa, aati, valuesize, key); // or // *aaGetRvalueX(aa, keyti, valuesize, key); TypeAArray *taa = (TypeAArray *)t1; ... elem* ti; if (ie-modifiable) { n1 = el_una(OPaddr, TYnptr, n1); s = aaGetSymbol(taa, GetY, 1); ti = toElem(getInternalTypeInfo(taa, NULL), irs); // --- } else { s = aaGetSymbol(taa, GetRvalueX, 1); ti = toElem(getInternalTypeInfo(taa-index, NULL), irs); } //printf(taa-index = %s\n, taa-index-toChars()); //printf(ti:\n); elem_print(ti); elem* ep = el_params(n2, valuesize, ti, n1, NULL); If ie-modifiable (the IndexExp appears in left hand side of an assignment expression), typeid(taa) is set to the 2nd argument of _aaGetY(). But, if taa is not mutable, it will be a TypeInfo_Const reference that points TypeInfo_AssociativeArray. On the other hand, the _aaGetY() function is defined as: void* _aaGetY(AA* aa, const TypeInfo_AssociativeArray ti, in size_t valuesize, in void* pkey) { if (aa.impl is null) { aa.impl = new Impl(); aa.impl.buckets = aa.impl.binit[]; aa.impl.firstUsedBucket = aa.impl.buckets.length; aa.impl._keyti = cast() ti.key; // - } return _aaGetImpl(aa, ti.key, valuesize, pkey); } And ti does not point an instance of TypeInfo_AssociativeArray, so will cause segfault at the ti.key access. --
[Issue 9495] Win64 vararg issue when first argument is 8 byte
https://issues.dlang.org/show_bug.cgi?id=9495 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|RESOLVED|REOPENED CC||yebbl...@gmail.com Resolution|FIXED |--- --- Comment #3 from yebblies yebbl...@gmail.com --- This bug still exists for va_start. --
[Issue 2116] Very incomplete docs for std.c.process
https://issues.dlang.org/show_bug.cgi?id=2116 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |WONTFIX --
[Issue 11467] [CTFE] Overlapping array copy is allowed in CT
https://issues.dlang.org/show_bug.cgi?id=11467 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #1 from Kenji Hara k.hara...@gmail.com --- https://github.com/D-Programming-Language/dmd/pull/4332 --
[Issue 14023] [CTFE] postblits/destructors not called on static array index assignment
https://issues.dlang.org/show_bug.cgi?id=14023 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/cb7b27ae21ccf79c5981fdf10c80e2ab4720c3d7 fix Issue 14023 - [CTFE] postblits/destructors not called on static array index assignment https://github.com/D-Programming-Language/dmd/commit/f96ab68fb1530b9a9684d7a62fb59ba3ee90aa00 Merge pull request #4329 from 9rnsr/fix_ctfe Issue 14022 14023 - [CTFE] postblits/destructors not called on static array assignment --
[Issue 14022] [CTFE] postblits/destructors not called on static array field assignment
https://issues.dlang.org/show_bug.cgi?id=14022 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/045ed4677f38b8d1e42d5153a9bd68855ffab212 fix Issue 14022 - [CTFE] postblits/destructors not called on static array field assignment https://github.com/D-Programming-Language/dmd/commit/f96ab68fb1530b9a9684d7a62fb59ba3ee90aa00 Merge pull request #4329 from 9rnsr/fix_ctfe Issue 14022 14023 - [CTFE] postblits/destructors not called on static array assignment --
[Issue 13669] [CTFE] Destructor call on static array variable is not yet supported in CTFE
https://issues.dlang.org/show_bug.cgi?id=13669 --- Comment #3 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/59a5fd49d1f03be8d0ac44abf03c109880f2aefb Move issue 13669 test in runnable, and fix order of dtor calls --
[Issue 14023] [CTFE] postblits/destructors not called on static array index assignment
https://issues.dlang.org/show_bug.cgi?id=14023 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 14022] [CTFE] postblits/destructors not called on static array field assignment
https://issues.dlang.org/show_bug.cgi?id=14022 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 13661] static array init does not call destructors
https://issues.dlang.org/show_bug.cgi?id=13661 --- Comment #5 from github-bugzi...@puremagic.com --- Commit pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/3b4420f8b28839256ad27b976e0861339941badf More correct behavior for issue 13661 --
[Issue 5698] va_arg sets wrong length for (u)short[]
https://issues.dlang.org/show_bug.cgi?id=5698 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #3 from AndyC a...@squeakycode.net --- The example code (after changing tango.stdc.stdarg to core.stdc.stdarg) doesnt compile anymore (DMD v2.066.1) I'd guess there are newer/better ways to handle this, so I'd recommend closing it. I get: /usr/include/dmd/druntime/import/core/stdc/stdarg.d(67): Error: cannot implicitly convert expression (cast(void*)(cast(uint)p + (tsize + 4u - 1u 4294967292u))) of type void* to char* main.d(15): Error: template instance core.stdc.stdarg.va_arg!() error instantiating main.d(57):instantiated from here: varar_!ubyte --
[Issue 14042] New: std.conv.to of a immutable char pointer
https://issues.dlang.org/show_bug.cgi?id=14042 Issue ID: 14042 Summary: std.conv.to of a immutable char pointer Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: regression Priority: P1 Component: Phobos Assignee: nob...@puremagic.com Reporter: bearophile_h...@eml.cc This seems a regression: void main() { import std.conv: to; immutable(char)* ptr = hello.ptr; auto result = ptr.to!(char[]); } ...\dmd2\src\phobos\std\conv.d(871,16): Error: cannot implicitly convert expression (value ? dup(value[0..strlen(value)]) : null) of type const(char)[] to char[] ...\dmd2\src\phobos\std\conv.d(287,24): Error: template instance std.conv.toImpl!(char[], immutable(char)*) error instantiating test.d(4,22):instantiated from here: to!(immutable(char)*) --
[Issue 12496] __traits(parent, x) returns incorrect type
https://issues.dlang.org/show_bug.cgi?id=12496 --- Comment #2 from Mike slavo5...@yahoo.com --- Possibly the same as Issue 13372 --
[Issue 13372] traits parent shows template function as its own parent
https://issues.dlang.org/show_bug.cgi?id=13372 Mike slavo5...@yahoo.com changed: What|Removed |Added CC||slavo5...@yahoo.com --- Comment #1 from Mike slavo5...@yahoo.com --- Looks like this might be the same as Issue 12496 --
[Issue 14039] New: function is incorrectly inferred as 'pure'
https://issues.dlang.org/show_bug.cgi?id=14039 Issue ID: 14039 Summary: function is incorrectly inferred as 'pure' Product: D Version: D2 Hardware: All OS: All Status: NEW Severity: normal Priority: P1 Component: DMD Assignee: nob...@puremagic.com Reporter: bugzi...@digitalmars.com void fa() {} auto fb10148(T)() { struct A(S) { void fc(T2)() { fa(); } this(S a) {} } return A!int.init; } void test10148() { fb10148!int.fc!int; } when compiled: foo.d(9): Error: pure function 'foo.fb10148!int.fb10148.A!int.A.fc!int.fc' cannot call impure function 'foo.fa' But calling fa() should have made fc() into an impure function. --
[Issue 12572] pragma(lib, curl) and -Lcurl broken
https://issues.dlang.org/show_bug.cgi?id=12572 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Severity|critical|blocker --
[Issue 14040] New: Doesn't use assignment in slice
https://issues.dlang.org/show_bug.cgi?id=14040 Issue ID: 14040 Summary: Doesn't use assignment in slice Product: D Version: unspecified Hardware: x86_64 OS: Windows Status: NEW Severity: regression Priority: P1 Component: DMD Assignee: nob...@puremagic.com Reporter: alphaglosi...@gmail.com Example code: import std.stdio; void main() { uint[] values = [0, 1, 2, 3, 4, 5, 6, 7]; uint offset = 2; writeln(values[offset .. offset += 2]); writeln(offset); } Outputs: [] 4 Expected output: [2, 3] 4 Works correctly in LDC 2.063.2 (thanks DPaste). Doesn't work in DMD 2.065 or 2.066.1 --
[Issue 13337] Invalid extern C++ namespace resolution
https://issues.dlang.org/show_bug.cgi?id=13337 --- Comment #3 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/a38205be75814c7ea2aa8e76a2528890ba9d6570 fix Issue 13337 - Invalid extern C++ namespace resolution https://github.com/D-Programming-Language/dmd/commit/15e52b13802017f264b1812061b34a003eee4a74 Merge pull request #4333 from gchatelet/master fix Issue 13337 - Invalid extern C++ namespace resolution --
[Issue 13726] Build Phobos and Druntime with stack frames enabled (-gs)
https://issues.dlang.org/show_bug.cgi?id=13726 --- Comment #13 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Martin Nowak from comment #12) There is so much we can do to improve stack traces, but enforcing stack frames is a performance trade-off. On Windows, breakpointing onInvalidMemoryOperationError does not result in a readable stack trace when using Visual Studio with neither Win32, Win32+cv2pdb, or Win64. This means that we are not emitting debug information that can replace stack frames for either CV or PDB formats. --
[Issue 4310] variadic templates article example code uses std.stdarg incorrectly
https://issues.dlang.org/show_bug.cgi?id=4310 AndyC a...@squeakycode.net changed: What|Removed |Added Status|NEW |RESOLVED CC||a...@squeakycode.net Resolution|--- |WONTFIX --- Comment #2 from AndyC a...@squeakycode.net --- closing: that page no longer uses size_t or std.stdarg --
[Issue 9495] Win64 vararg issue when first argument is 8 byte
https://issues.dlang.org/show_bug.cgi?id=9495 --- Comment #5 from yebblies yebbl...@gmail.com --- (In reply to Benjamin Thaut from comment #4) Repo case? From https://github.com/D-Programming-Language/phobos/pull/2902 void printf(string format, ...) { va_list ap; va_start(ap, format); vprintf(format, ap); va_end(ap); } va_start does something like `ap = (cast(void*)format + size_t.sizeof)`, which doesn't work as format is the address of where the slice is stored on the stack, not the address of where the low-level argument (a pointer to the slice) was passed. A workaround is to pass const(char)* only or pass ptr and length in distinct parameters to avoid the 8 bytes case in the abi. --
[Issue 13726] Build Phobos and Druntime with stack frames enabled (-gs)
https://issues.dlang.org/show_bug.cgi?id=13726 --- Comment #14 from Vladimir Panteleev thecybersha...@gmail.com --- (In reply to Vladimir Panteleev from comment #0) An example use case where stack frames are useful is debugging InvalidMemoryOperation errors. Right now, there are TWO threads in the front page of digitalmars.D.learn asking about this error. Nobody can give good advice on reliably determining what exactly causes it. I'm writing a wiki page with a guide on how to use Digger to rebuild D so you can get a good stack trace, but right now the situation is miserable. --
[Issue 14040] Doesn't use assignment in slice
https://issues.dlang.org/show_bug.cgi?id=14040 bearophile_h...@eml.cc changed: What|Removed |Added CC||bearophile_h...@eml.cc --- Comment #1 from bearophile_h...@eml.cc --- Code like this is ugly, if I see code like this I refactor it immediately: values[offset .. offset += 2] Into two lines like: values[offset .. offset + 2] offset += 2; --
[Issue 5494] [patch,enh] Issues with std.stdarg
https://issues.dlang.org/show_bug.cgi?id=5494 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #3 from AndyC a...@squeakycode.net --- I'm gonna guess we can close this: Original report is for std.stdarg which is gone. std.c.stdarg forwards to core.stdc.stdarg Last comment: I'd suggest making core.stdarg simply forward to core.stdc.stdarg, which is correct Which seems to have happened. However there is no bug code so I cannot test core.stdc.stdarg I'd vote close this, and if its still a problem then a new report is filed with current names and some test code. --
[Issue 14041] New: Refused writeln of a fixed size array of chars
https://issues.dlang.org/show_bug.cgi?id=14041 Issue ID: 14041 Summary: Refused writeln of a fixed size array of chars Product: D Version: D2 Hardware: x86 OS: Windows Status: NEW Severity: regression Priority: P1 Component: Phobos Assignee: nob...@puremagic.com Reporter: bearophile_h...@eml.cc This could be a regression: void main() { import std.stdio; char[8] a; writeln(a); } Dmd 2.067alpha: ...\dmd2\src\phobos\std\stdio.d(2918,14): Error: template std.stdio.File.LockingTextWriter.put cannot deduce function from argument types !()(char[8]), candidates are: ...\dmd2\src\phobos\std\stdio.d(2316,14): std.stdio.File.LockingTextWriter.put(A)(A writeme) if (is(ElementType!A : const(dchar)) isInputRange!A !isInfinite!A) ...\dmd2\src\phobos\std\stdio.d(2352,14): std.stdio.File.LockingTextWriter.put(C)(C c) if (is(C : const(dchar))) test.d(4,12): Error: template instance std.stdio.writeln!(char[8]) error instantiating --
[Issue 5190] std.stdio should have File.fdopen
https://issues.dlang.org/show_bug.cgi?id=5190 AndyC a...@squeakycode.net changed: What|Removed |Added Status|NEW |RESOLVED CC||a...@squeakycode.net Resolution|--- |FIXED --- Comment #2 from AndyC a...@squeakycode.net --- fixed: https://github.com/D-Programming-Language/phobos/commit/b593b30ce125ba5b88d606f962ca2f86bfc15c8d --
[Issue 4718] Few Phobos modules renames
https://issues.dlang.org/show_bug.cgi?id=4718 AndyC a...@squeakycode.net changed: What|Removed |Added Status|NEW |RESOLVED CC||a...@squeakycode.net Resolution|--- |WONTFIX --- Comment #7 from AndyC a...@squeakycode.net --- Closing: I'd guess this isnt gonna happen, the names are locked in by now. --
[Issue 13963] BigInt modulo ulong is rejected
https://issues.dlang.org/show_bug.cgi?id=13963 --- Comment #2 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/phobos https://github.com/D-Programming-Language/phobos/commit/f8bb3e4cd8f90af3d9004392f7668759d57005f2 Fix Issue 13963 - BigInt modulo ulong is rejected https://github.com/D-Programming-Language/phobos/commit/3fbb2c33dd7687d8d8538903878f5d60e4362e27 Merge pull request #2864 from e10s/patch-6 Fix Issue 13963 - BigInt modulo ulong is rejected --
[Issue 13963] BigInt modulo ulong is rejected
https://issues.dlang.org/show_bug.cgi?id=13963 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 14038] [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 --- Comment #4 from github-bugzi...@puremagic.com --- Commits pushed to master at https://github.com/D-Programming-Language/dmd https://github.com/D-Programming-Language/dmd/commit/0044e35b0e4d24435bebb15461dd170ccd59fe78 fix Issue 14038 - Non-mutable AA initialization segfaults in runtime https://github.com/D-Programming-Language/dmd/commit/47ff8276ab022b7846dc493e838e5a0703a71937 Merge pull request #4334 from 9rnsr/fix14038 [REG2.067a] Issue 14038 - Non-mutable AA initialization segfaults in runtime --
[Issue 14038] [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 github-bugzi...@puremagic.com changed: What|Removed |Added Status|NEW |RESOLVED Resolution|--- |FIXED --
[Issue 5895] Object.clear() doesn't work as expected for pointers to structs
https://issues.dlang.org/show_bug.cgi?id=5895 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #2 from AndyC a...@squeakycode.net --- This might be closeable. object.close() is deprecated and the compiler warns you should use destroy() instead. However: import std.stdio; struct Bar { ~this() { writeln(bye); } } void main() { Bar *b = new Bar(); destroy(b); } Still doesnt call the destructor ... but that's because it needs to be called as: destroy(*b) There is form discussion here: http://forum.dlang.org/thread/fpvoxowzicqoqlita...@forum.dlang.org I wonder if there is any way the compiler can warn on: Bar *b = new Bar(); destroy(b); If so I think that should be a new bug, and this one closed. --
[Issue 2116] Very incomplete docs for std.c.process
https://issues.dlang.org/show_bug.cgi?id=2116 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #2 from AndyC a...@squeakycode.net --- recommend closing, std.c.process is deprecated. no need to document it anymore. --
[Issue 14036] Do not throw FinalizeError on OutOfMemoryError or InvalidMemoryOperationError
https://issues.dlang.org/show_bug.cgi?id=14036 Vladimir Panteleev thecybersha...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #1 from Vladimir Panteleev thecybersha...@gmail.com --- https://github.com/D-Programming-Language/druntime/pull/1123 --
[Issue 14038] [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 --- Comment #1 from Kenji Hara k.hara...@gmail.com --- More better test case: class C { immutable ubyte[string] wordsAA; this() { wordsAA[zero] = 0; // segfaults } } void main() { auto c = new C(); } The original code is initializing immutable AA inside foreach loop. I think it would be a multiple variable initialization and essentially should be disallowed. --
[Issue 13858] Wrong warning about unreachable code with break/goto case
https://issues.dlang.org/show_bug.cgi?id=13858 --- Comment #4 from Dicebot pub...@dicebot.lv --- I'll mark it as hard to fix, better use workaround then :) --
[Issue 1561] AA's create many false references for garbage collector
https://issues.dlang.org/show_bug.cgi?id=1561 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net --- Comment #3 from AndyC a...@squeakycode.net --- tested on DMD v2.066.1 Also without gc.getStats, just watching top. No memory leak detected. It actually acts the same for me with or without the call to GC.collect(); As this report includes both D1 and D2, and its not an issue in D2, I'd recommend closing. My Test: import std.stdio; // Just an ordinary AA with a lot of values. // neither keys nor values look like pointers. class BigAA { int[int] aa; this() { for(int i=0;i1000;i++) { aa[i] = i; } } } void main() { int nloops = 10_000; auto b = new BigAA[100]; for(int i=0; inloops; ++i) { // Create some AAs (overwriting old ones) foreach(ref v; b) { v = new BigAA; } //GC.collect(); } } --
[Issue 13881] Optional length template argument for std.range.takeExactly
https://issues.dlang.org/show_bug.cgi?id=13881 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment #1 from yebblies yebbl...@gmail.com --- Range length can't be a compile-time constant, or it won't be able to support popFront and isn't a range. --
[Issue 13882] Smarter std.algorithm.copy
https://issues.dlang.org/show_bug.cgi?id=13882 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment #1 from yebblies yebbl...@gmail.com --- Implementing issue 13185 would make this possible, without specializing for static arrays. Length of slices of static arrays can be found via const-folding, and if matching length was checked in an in-contract it could be reported at compile-time. --
[Issue 13858] Wrong warning about unreachable code with break/goto case
https://issues.dlang.org/show_bug.cgi?id=13858 yebblies yebbl...@gmail.com changed: What|Removed |Added CC||yebbl...@gmail.com --- Comment #3 from yebblies yebbl...@gmail.com --- (In reply to Andrej Mitrovic from comment #1) Also, the same thing happens with 'goto', although I'm not sure whether there's a semantic difference between the two (I assume so). If by that you mean replacing the 'break LSwitch' with 'goto LSwitch' then the warning is correct, because that would be an infinite loop. The problem here is that LabelStatement::blockExit just returns the blockExit of the labeled statement, and isn't really designed for handling a label containing a goto to itself. BreakStatement::blockExit produces BEgoto when used with a label, but this is overly vague, as labeled breaking from a switch should produce BEfallthru. I tried changing SwitchStatement::blockExit to treat an internal BEgoto as BEfallthrough, like ForStatement does, but it seems to also use BEgoto to indicate internal 'goto case's and that change leads to false positive no return exp; or assert(0) errors. I'm not sure it's possible to fix this without properly building and walking a CFG, maybe somebody else knows for sure. --
[Issue 13866] tools repo 2.066.1 release tag
https://issues.dlang.org/show_bug.cgi?id=13866 yebblies yebbl...@gmail.com changed: What|Removed |Added Status|NEW |RESOLVED CC||yebbl...@gmail.com Resolution|--- |INVALID --- Comment #2 from yebblies yebbl...@gmail.com --- All of those tags point to the same commit. I don't know why they were created out of order, but it doesn't matter. --
[Issue 14025] unittests for memoize fail intermittently
https://issues.dlang.org/show_bug.cgi?id=14025 Rainer Schuetze r.sagita...@gmx.de changed: What|Removed |Added Keywords||pull --- Comment #1 from Rainer Schuetze r.sagita...@gmx.de --- https://github.com/D-Programming-Language/phobos/pull/2901 --
[Issue 13337] Invalid extern C++ namespace resolution
https://issues.dlang.org/show_bug.cgi?id=13337 --- Comment #2 from Guillaume Chatelet chatelet.guilla...@gmail.com --- Digging into it, it looks like a parsing issue and not a mangling issue. --
[Issue 13867] Overriding a method from an extern(C++) interface requires extern(C++) on the method definition
https://issues.dlang.org/show_bug.cgi?id=13867 yebblies yebbl...@gmail.com changed: What|Removed |Added Keywords||diagnostic CC||yebbl...@gmail.com Hardware|x86_64 |All OS|Linux |All --
[Issue 13870] [ICE] shared or immutable types can not be mapped to C++ (immutable(char))
https://issues.dlang.org/show_bug.cgi?id=13870 yebblies yebbl...@gmail.com changed: What|Removed |Added Keywords||diagnostic CC||yebbl...@gmail.com Hardware|x86_64 |All OS|Linux |All --- Comment #1 from yebblies yebbl...@gmail.com --- Only the diagnostic part of this is critical as the ICE is not something that should work, just something that should be caught earlier in compilation. --
[Issue 9889] Incorrect rounding on floating value formatting
https://issues.dlang.org/show_bug.cgi?id=9889 AndyC a...@squeakycode.net changed: What|Removed |Added CC||a...@squeakycode.net OS|Windows |Linux --- Comment #1 from AndyC a...@squeakycode.net --- Tested on DMD v2.066.1, this runs fine. import std.string; void main() { assert(format(%.1f, 0.09) == 0.1); // Failed, formatted as 0.0 assert(format(%.1f, -0.09) == -0.1); // Failed, formatted as -0.0 assert(format(%.1f, 0.095) == 0.1); // OK assert(format(%.1f, -0.095) == -0.1); // OK assert(format(%.1f, 0.094) == 0.1); // Failed, formatted as 0.0 assert(format(%.1f, -0.094) == -0.1); // Failed, formatted as -0.0 } Report was on windows, I tested in on linux, hopefully format() isnt os specific. Report mentions std.format.formatValue but doesnt test it. --
[Issue 13875] extern(C++) interfaces cannot be used as associative array keys
https://issues.dlang.org/show_bug.cgi?id=13875 yebblies yebbl...@gmail.com changed: What|Removed |Added Keywords||C++, wrong-code CC||yebbl...@gmail.com Hardware|x86_64 |All OS|Linux |All --
[Issue 9889] Incorrect rounding on floating value formatting
https://issues.dlang.org/show_bug.cgi?id=9889 Andrei Alexandrescu and...@erdani.com changed: What|Removed |Added Status|NEW |RESOLVED CC||and...@erdani.com Resolution|--- |FIXED --- Comment #2 from Andrei Alexandrescu and...@erdani.com --- Closing preemptively according to http://forum.dlang.org/thread/fsmjexsfxtqveqffi...@forum.dlang.org#post-ybwwdcpzianfozqcflcv:40forum.dlang.org. Please reopen if necessary, thanks. --
[Issue 9023] CTFE: cannot use ~= on an empty AA.
https://issues.dlang.org/show_bug.cgi?id=9023 Kenji Hara k.hara...@gmail.com changed: What|Removed |Added Keywords||pull --- Comment #1 from Kenji Hara k.hara...@gmail.com --- D2 fix: https://github.com/D-Programming-Language/dmd/pull/4331 --
[Issue 14038] [REG2.067a] Non-mutable AA initialization segfaults in runtime
https://issues.dlang.org/show_bug.cgi?id=14038 --- Comment #2 from Kenji Hara k.hara...@gmail.com --- (In reply to Kenji Hara from comment #1) More close to the original: static immutable ubyte[string] wordsAA; static this() { wordsAA[zero] = 0; } void main() {} --