[Issue 17595] Fix warnings in PDF build & fail on specific warnings in the future

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17595

Mathias LANG  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||pro.mathias.l...@gmail.com
 Resolution|--- |WONTFIX

--- Comment #1 from Mathias LANG  ---
PDF generation has been removed: https://github.com/dlang/dlang.org/pull/2823

--


[Issue 20169] Cannot allocate immutable class on the stack with scope

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=20169

Mathias LANG  changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||pro.mathias.l...@gmail.com
 Resolution|--- |DUPLICATE

--- Comment #1 from Mathias LANG  ---


*** This issue has been marked as a duplicate of issue 19272 ***

--


[Issue 19272] scope class and const/immutable doesn't work together

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19272

Mathias LANG  changed:

   What|Removed |Added

 CC||atila.ne...@gmail.com

--- Comment #1 from Mathias LANG  ---
*** Issue 20169 has been marked as a duplicate of this issue. ***

--


[Issue 12490] No "Error: , has no effect" Error for comma expression LHS

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=12490

Dlang Bot  changed:

   What|Removed |Added

   Keywords||pull

--- Comment #2 from Dlang Bot  ---
@NilsLankila created dlang/dmd pull request #11377 "fix issue 12490 - No
"Error: , has no effect" Error for comma expression LHS" fixing this issue:

- fix issue 12490 - No "Error: , has no effect" Error for comma expression LHS

  Following a comment in sideeffect.d on how to check the LHS.

https://github.com/dlang/dmd/pull/11377

--


[Issue 21016] New: `Type.Field.init` is `typeof(Type.Field).init`, not the field initializer

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21016

  Issue ID: 21016
   Summary: `Type.Field.init` is `typeof(Type.Field).init`, not
the field initializer
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: pro.mathias.l...@gmail.com

```
struct Params
{
uint value = 4242;
}

pragma(msg, Params.value.init);
```

This should print `4242`, not `0u`. It can be worked around by using
`Params.init.value` but that hoop shouldn't be necessary.

Likewise the following should work:
```
template Default (alias Field)
{
enum Default = Field.init;
}
pragma(msg, Default!(Params.value));
```

--


[Issue 21015] New: aa.byKeyValue, byKey provide mutable reference access to keys

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21015

  Issue ID: 21015
   Summary: aa.byKeyValue, byKey provide mutable reference access
to keys
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: normal
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: schvei...@yahoo.com

e.g.:

int[int] aa;
aa[5] = 6;
foreach(ref k; aa.byKey) k = 10;

writeln(aa); // [10:6]

foreach(kvp; aa.byKeyValue) kvp.key = 11;

writeln(aa); // [11:6]

--


[Issue 21014] New: aa.byKeyValue, byKey, byValue very under-documented

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21014

  Issue ID: 21014
   Summary: aa.byKeyValue, byKey, byValue very under-documented
   Product: D
   Version: D2
  Hardware: x86
OS: Mac OS X
Status: NEW
  Severity: enhancement
  Priority: P1
 Component: dlang.org
  Assignee: nob...@puremagic.com
  Reporter: schvei...@yahoo.com

e.g.:

https://github.com/dlang/druntime/blob/d3dfa0778fbad77482b0ae8e7e528b55aa417c19/src/object.d#L2491-L2497

```
/***
 * Returns a forward range over the key value pairs of the associative array.
 * Params:
 *  aa = The associative array.
 * Returns:
 *  A forward range.
 */
```

No indication of what the range's front returns, if items are returned by
reference, if changes to the AA invalidate the type returned by front, etc.

In fact, the front type is a voldemort type with a ref accessor for both key
and value (named as such).

Putting in documentation as to what the range provides would be helpful. I
shouldn't have to look at the source.

--


[Issue 18627] std.complex is a lot slower than builtin complex types at number crunching

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=18627

--- Comment #10 from Iain Buclaw  ---
(In reply to ponce from comment #4)
> This benchmark is a variation that does only division.
> 
> --- divide.d

* With gdc -O2 -frelease -m64

With cfloat: 11 secs, 204 ms, 475 μs, and 2 hnsecs
With cdouble: 13 secs, 420 ms, 497 μs, and 6 hnsecs
With Complex!float: 4 secs, 689 ms, 546 μs, and 2 hnsecs
With Complex!double: 8 secs, 903 ms, 172 μs, and 4 hnsecs

* With gdc -O2 -frelease -m32

With cfloat: 29 secs, 471 ms, 678 μs, and 9 hnsecs
With cdouble: 29 secs, 176 ms, 189 μs, and 2 hnsecs
With Complex!float: 13 secs, 379 ms, 856 μs, and 8 hnsecs
With Complex!double: 18 secs, 240 ms, 975 μs, and 5 hnsecs

Native complex floating point must die.

--


[Issue 19093] 'cannot alias itself' when using a template instantiation in a template parameter

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=19093

--- Comment #2 from Simen Kjaeraas  ---
Works better if Foo's parameter is called something else:

alias Foo(U) = U; // undefined identifier T

Obviously you're right about the real problem, and the error message is a case
of bad diagnostic. However, I think you should be allowed to reuse the previous
template params.

--


[Issue 21013] dwarfeh: Comparing LSDA is too unreliable to determine if two exceptions can be merged

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21013

kinke  changed:

   What|Removed |Added

 CC||ki...@gmx.net

--- Comment #3 from kinke  ---
Excellent findings. I think that's finally the explaination for one remaining
unittest failure with 32-bit ARM a few years back (std.random IIRC; could be
worked around by disabling inlining).

I'm still not convinced exception chaining is worth all these troubles.

--


[Issue 21008] dmd segfaults because of __traits(getMember, ...) and virtual function overriding

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21008

Basile-z  changed:

   What|Removed |Added

   Keywords||ice

--


[Issue 21008] dmd segfaults because of __traits(getMember, ...) and virtual function overriding

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21008

--- Comment #2 from moonlightsenti...@disroot.org ---
Slightly different stack trace for current HEAD
(3c8b519cbc30935e0b66d97d04663156bbd3dc63):

core.exception.RangeError@dmd/root/array.d(259): Range violation

??:? _d_arrayboundsp [0x7f1929da2a75]
dmd/root/array.d:259 _ZN5ArrayIP7DsymbolEixEm [0x7f1929be65d6]
dmd/dsymbolsem.d:3724
_ZN22DsymbolSemanticVisitor23funcDeclarationSemanticEP15FuncDeclaration
[0x7f1929b55d7e]
dmd/dsymbolsem.d:4114 _ZN22DsymbolSemanticVisitor5visitEP15FuncDeclaration
[0x7f1929b57194]
dmd/func.d:2558 _ZN15FuncDeclaration6acceptEP7Visitor [0x7f1929bbd8e5]
dmd/dsymbolsem.d:564 _Z15dsymbolSemanticP7DsymbolP5Scope [0x7f1929b4be75]
dmd/typesem.d:4305 dmd.expression.Expression dmd.typesem.dotExp(dmd.mtype.Type,
dmd.dscope.Scope*, dmd.expression.Expression, dmd.identifier.Identifier,
int).visitClass(dmd.mtype.TypeClass) [0x7f1929c8fe5a]
dmd/typesem.d:4350 dmd.expression.Expression dmd.typesem.dotExp(dmd.mtype.Type,
dmd.dscope.Scope*, dmd.expression.Expression, dmd.identifier.Identifier, int)
[0x7f1929c8b346]
dmd/expressionsem.d:11890 dmd.expression.Expression
dmd.expressionsem.semanticY(dmd.expression.DotIdExp, dmd.dscope.Scope*, int)
[0x7f1929bb656f]
dmd/expressionsem.d:6151 _ZN25ExpressionSemanticVisitor5visitEP8DotIdExp
[0x7f1929ba4b55]
dmd/expression.d:4574 _ZN8DotIdExp6acceptEP7Visitor [0x7f1929b8a59d]
dmd/expressionsem.d:11488 _Z18expressionSemanticP10ExpressionP5Scope
[0x7f1929bb4d2f]
dmd/traits.d:1002 dmd.expression.Expression
dmd.traits.semanticTraits(dmd.expression.TraitsExp, dmd.dscope.Scope*)
[0x7f1929c7e029]
dmd/expressionsem.d:5288 _ZN25ExpressionSemanticVisitor5visitEP9TraitsExp
[0x7f1929ba1b6c]
dmd/expression.d:4009 _ZN9TraitsExp6acceptEP7Visitor [0x7f1929b88dd1]
dmd/expressionsem.d:11488 _Z18expressionSemanticP10ExpressionP5Scope
[0x7f1929bb4d2f]
dmd/statementsem.d:186 _ZN24StatementSemanticVisitor5visitEP12ExpStatement
[0x7f1929c669d1]
dmd/statement.d:750 _ZN12ExpStatement6acceptEP7Visitor [0x7f1929c6243d]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/statementsem.d:244 _ZN24StatementSemanticVisitor5visitEP17CompoundStatement
[0x7f1929c66c93]
dmd/statement.d:938 _ZN17CompoundStatement6acceptEP7Visitor [0x7f1929c62cb9]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/statementsem.d:445 _ZN24StatementSemanticVisitor5visitEP14ScopeStatement
[0x7f1929c677e1]
dmd/statement.d:1045 _ZN14ScopeStatement6acceptEP7Visitor [0x7f1929c630b9]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/statementsem.d:419
_ZN24StatementSemanticVisitor5visitEP21UnrolledLoopStatement [0x7f1929c676b1]
dmd/statement.d:1003 _ZN21UnrolledLoopStatement6acceptEP7Visitor
[0x7f1929c62f59]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/statementsem.d:1165 _ZN24StatementSemanticVisitor5visitEP16ForeachStatement
[0x7f1929c68607]
dmd/statement.d:1320 _ZN16ForeachStatement6acceptEP7Visitor [0x7f1929c638b1]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/statementsem.d:244 _ZN24StatementSemanticVisitor5visitEP17CompoundStatement
[0x7f1929c66c93]
dmd/statement.d:938 _ZN17CompoundStatement6acceptEP7Visitor [0x7f1929c62cb9]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7f1929c668bb]
dmd/semantic3.d:575 _ZN16Semantic3Visitor5visitEP15FuncDeclaration
[0x7f1929c5c712]
dmd/func.d:2558 _ZN15FuncDeclaration6acceptEP7Visitor [0x7f1929bbd8e5]
dmd/semantic3.d:81 _Z9semantic3P7DsymbolP5Scope [0x7f1929c5b14d]
dmd/func.d:455 _ZN15FuncDeclaration17functionSemantic3Ev [0x7f1929bb85b1]
dmd/func.d:429 _ZN15FuncDeclaration16functionSemanticEv [0x7f1929bb84c6]
dmd/expressionsem.d:918 dmd.expression.Expression
dmd.expressionsem.symbolToExp(dmd.dsymbol.Dsymbol, ref const(dmd.globals.Loc),
dmd.dscope.Scope*, bool) [0x7f1929b932c8]
dmd/expressionsem.d:3331 _ZN25ExpressionSemanticVisitor5visitEP8ScopeExp
[0x7f1929b9a813]
dmd/expression.d:3320 _ZN8ScopeExp6acceptEP7Visitor [0x7f1929b872f9]
dmd/expressionsem.d:11488 _Z18expressionSemanticP10ExpressionP5Scope
[0x7f1929bb4d2f]
dmd/expressionsem.d:101 bool dmd.expressionsem.expressionsToString(ref
dmd.root.outbuffer.OutBuffer, dmd.dscope.Scope*,
dmd.root.array.Array!(dmd.expression.Expression).Array*) [0x7f1929b90e62]
dmd/dsymbolsem.d:2101
_ZN22DsymbolSemanticVisitor9compileItEP18CompileDeclaration [0x7f1929b50ef4]
dmd/dsymbolsem.d:2131 _ZN22DsymbolSemanticVisitor5visitEP18CompileDeclaration
[0x7f1929b5115f]
dmd/attrib.d:1344 _ZN18CompileDeclaration6acceptEP7Visitor [0x7f1929ad31a5]
dmd/dsymbolsem.d:564 _Z15dsymbolSemanticP7DsymbolP5Scope [0x7f1929b4be75]
dmd/dsymbolsem.d:5369 void
dmd.dsymbolsem.DsymbolSemanticVisitor.visit(dmd.dclass.ClassDeclaration).__lambda10!(dmd.dsymbol.Dsymbol).__lambda10(dmd.dsymbol.Dsymbol)
[0x7f1929b5bf0f]
dmd/dsymbol.d:99 void
dmd.dsymbol.foreachDsymbol(dmd.root.array.Array!(dmd.dsymbol.Dsymbol).Array*,

[Issue 21008] dmd segfaults because of __traits(getMember, ...) and virtual function overriding

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21008

moonlightsenti...@disroot.org changed:

   What|Removed |Added

 CC||moonlightsentinel@disroot.o
   ||rg
   Hardware|x86 |All

--- Comment #1 from moonlightsenti...@disroot.org ---
Reduced test case:

==
class ControllerBase(T)
{
bool after() {}

mixin(handleMiddlewareAnnotation!T);
}

class DemoController : ControllerBase!DemoController
{
bool after() {}
}

string handleMiddlewareAnnotation(T)()
{
foreach (memberName; __traits(allMembers, T))
__traits(getMember, T, memberName);
}
==

Running a debug dmd yields the following trace:

dmd -c -o- test.d

---
ERROR: This is a compiler bug.
Please report it via https://issues.dlang.org/enter_bug.cgi
with, preferably, a reduced, reproducible example and the information below.
DustMite (https://github.com/CyberShadow/DustMite/wiki) can help with the
reduction.
---
DMD v2.092.1

predefs   DigitalMars Posix linux ELFv1 CRuntime_Glibc CppRuntime_Gcc
LittleEndian D_Version2 all D_SIMD D_InlineAsm_X86_64 X86_64 D_LP64 D_PIC
assert D_ModuleInfo D_Exceptions D_TypeInfo D_HardFloat
binary../generated/linux/debug/64/dmd
version   v2.092.1

config../generated/linux/debug/64/dmd.conf
DFLAGS-I../generated/linux/debug/64/../../../../../druntime/import
-I../generated/linux/debug/64/../../../../../phobos
-L-L../generated/linux/debug/64/../../../../../phobos/generated/linux/debug/64
-L--export-dynamic -fPIC
---
core.exception.RangeError@dmd/root/array.d(251): Range violation

??:? _d_arrayboundsp [0x7fc38279b939]
dmd/root/array.d:251 _ZN5ArrayIP7DsymbolEixEm [0x7fc3825e1bda]
dmd/dsymbolsem.d:3724
_ZN22DsymbolSemanticVisitor23funcDeclarationSemanticEP15FuncDeclaration
[0x7fc382551656]
dmd/dsymbolsem.d:4115 _ZN22DsymbolSemanticVisitor5visitEP15FuncDeclaration
[0x7fc382552aa4]
dmd/func.d:2564 _ZN15FuncDeclaration6acceptEP7Visitor [0x7fc3825b900d]
dmd/dsymbolsem.d:564 _Z15dsymbolSemanticP7DsymbolP5Scope [0x7fc38254774d]
dmd/typesem.d:4298 dmd.expression.Expression dmd.typesem.dotExp(dmd.mtype.Type,
dmd.dscope.Scope*, dmd.expression.Expression, dmd.identifier.Identifier,
int).visitClass(dmd.mtype.TypeClass) [0x7fc38268a516]
dmd/typesem.d:4343 dmd.expression.Expression dmd.typesem.dotExp(dmd.mtype.Type,
dmd.dscope.Scope*, dmd.expression.Expression, dmd.identifier.Identifier, int)
[0x7fc382685a02]
dmd/expressionsem.d:11889 dmd.expression.Expression
dmd.expressionsem.semanticY(dmd.expression.DotIdExp, dmd.dscope.Scope*, int)
[0x7fc3825b1cbb]
dmd/expressionsem.d:6150 _ZN25ExpressionSemanticVisitor5visitEP8DotIdExp
[0x7fc3825a02a1]
dmd/expression.d:4577 _ZN8DotIdExp6acceptEP7Visitor [0x7fc382585d59]
dmd/expressionsem.d:11487 _Z18expressionSemanticP10ExpressionP5Scope
[0x7fc3825b047b]
dmd/traits.d:1002 dmd.expression.Expression
dmd.traits.semanticTraits(dmd.expression.TraitsExp, dmd.dscope.Scope*)
[0x7fc38267876d]
dmd/expressionsem.d:5284 _ZN25ExpressionSemanticVisitor5visitEP9TraitsExp
[0x7fc38259d2a8]
dmd/expression.d:4012 _ZN9TraitsExp6acceptEP7Visitor [0x7fc38258458d]
dmd/expressionsem.d:11487 _Z18expressionSemanticP10ExpressionP5Scope
[0x7fc3825b047b]
dmd/statementsem.d:186 _ZN24StatementSemanticVisitor5visitEP12ExpStatement
[0x7fc382661179]
dmd/statement.d:750 _ZN12ExpStatement6acceptEP7Visitor [0x7fc38265cc61]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/statementsem.d:244 _ZN24StatementSemanticVisitor5visitEP17CompoundStatement
[0x7fc38266143b]
dmd/statement.d:938 _ZN17CompoundStatement6acceptEP7Visitor [0x7fc38265d4dd]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/statementsem.d:445 _ZN24StatementSemanticVisitor5visitEP14ScopeStatement
[0x7fc382661f89]
dmd/statement.d:1045 _ZN14ScopeStatement6acceptEP7Visitor [0x7fc38265d8dd]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/statementsem.d:419
_ZN24StatementSemanticVisitor5visitEP21UnrolledLoopStatement [0x7fc382661e59]
dmd/statement.d:1003 _ZN21UnrolledLoopStatement6acceptEP7Visitor
[0x7fc38265d77d]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/statementsem.d:1165 _ZN24StatementSemanticVisitor5visitEP16ForeachStatement
[0x7fc382662daf]
dmd/statement.d:1320 _ZN16ForeachStatement6acceptEP7Visitor [0x7fc38265e0d5]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/statementsem.d:244 _ZN24StatementSemanticVisitor5visitEP17CompoundStatement
[0x7fc38266143b]
dmd/statement.d:938 _ZN17CompoundStatement6acceptEP7Visitor [0x7fc38265d4dd]
dmd/statementsem.d:131 _Z17statementSemanticP9StatementP5Scope [0x7fc382661063]
dmd/semantic3.d:577 

[Issue 21013] dwarfeh: Comparing LSDA is too unreliable to determine if two exceptions can be merged

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21013

--- Comment #2 from Iain Buclaw  ---
(In reply to Iain Buclaw from comment #1)
> One stable input that could instead be used is the function FQN, or perhaps
> better, the hash of it.
> 

Though shortly after sending the last message, I now see that I was thinking
only about problem [2], and not what would also work for [1] as well.

What instead works for both would be if an internal state were to be updated
when entering each try/catch or try/finally region.

e.g:
---
void bug1513a()
{
 throw new Exception("d");
}

void bug1513()
{
try
{
///
_d_eh_setContext("bug1513");
///
try
{
///
_d_eh_setContext("bug1513");
///
bug1513a();
}
finally
{
   throw new Exception("f");
}
}
catch(Exception e)
{
assert(e.msg == "d");
assert(e.next.msg == "f");
assert(!e.next.next);
}
}
---

void test4()
{
void throw_catch()
{
try
{
///
_d_eh_setContext("test4.throw_catch");
///
throw new MyException;
}
catch (MyException)
{
}
catch (Exception)
{
assert(false);
}
}
try
{
///
_d_eh_setContext("test4");
///
try
{
///
_d_eh_setContext("test4");
///
throw new Exception("a");
}
finally
{
throw_catch();
}
}
catch(Exception e)
{
assert(e.msg == "a");
assert(!e.next);
}
}
---

Which means there's unfortunately going to be a heavy performance penalty for
using EH.

--


[Issue 21013] dwarfeh: Comparing LSDA is too unreliable to determine if two exceptions can be merged

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21013

--- Comment #1 from Iain Buclaw  ---
One stable input that could instead be used is the function FQN, or perhaps
better, the hash of it.

This cannot be done by changing the constructor signature of Exception/Error
to:

@nogc @safe pure nothrow this(string msg,
  string file = __FILE__,
  size_t line = __LINE__,
  Throwable nextInChain = null,
  string func = __PRETTY_FUNCTION__);

This does not work, as __FUNCTION__ will be the name of the constructor that
super() was called, not the function of the originating throw statement.  (Not
to mention that it breaks far to much user code to do so).

So the _d_throw function signature must change instead (I'm using a string here
for example purposes, a hash_t would be better IMO):

void _d_throw(Throwable object, string func);

So the calling code:

throw new Exception("msg");

Gets lowered as:

_d_throwX(Exception.__ctor(_d_newclass(__class)), "foo.bar");

And the ExceptionHeader created in _d_throwX saves this information:

ExceptionHeader *eh = ExceptionHeader.create(object, func);


The two referenced lines in the D personality functions would then be updated
as presented below:

[1]
---
// Don't combine when the exceptions are from different functions
if (eh.func != ehn.func)
{
//printf("break: %s %s\n", eh.func.ptr, ehn.func.ptr);
break;
}
---

[2]
---
// like __dmd_personality_v0, don't combine when the exceptions are
// from different functions (fixes issue 19831, exception thrown and
// caught while inside finally block)
if (eh.func != ehn.func)
{
// printf("break: %s %s\n", eh.func.ptr, ehn.func.ptr);
break;
}
---

--


[Issue 21013] dwarfeh: Comparing LSDA is too unreliable to determine if two exceptions can be merged

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21013

Iain Buclaw  changed:

   What|Removed |Added

   Keywords||GDC
 CC||ibuc...@gdcproject.org

--


[Issue 21013] New: dwarfeh: Comparing LSDA is too unreliable to determine if two exceptions can be merged

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21013

  Issue ID: 21013
   Summary: dwarfeh: Comparing LSDA is too unreliable to determine
if two exceptions can be merged
   Product: D
   Version: D2
  Hardware: All
OS: Linux
Status: NEW
  Severity: major
  Priority: P1
 Component: druntime
  Assignee: nob...@puremagic.com
  Reporter: ibuc...@gdcproject.org

The run-time implementation of D EH personality routines tries to cater for
merging two in-flight exceptions.  In order to do this for Dwarf/Unwind EH, it
assumes that each function will have only one LSDA, and it will be unique to
that function.

See [1] for combining two in-flight exceptions before switching to the handler,
and [2] for determining which of the in-flight Exceptions takes precedence when
search for a catch/finally handler.

[1]
https://github.com/dlang/druntime/blob/d3dfa0778fbad77482b0ae8e7e528b55aa417c19/src/rt/dwarfeh.d#L413-L418
[2]
https://github.com/dlang/druntime/blob/d3dfa0778fbad77482b0ae8e7e528b55aa417c19/src/rt/dwarfeh.d#L479-L485



Line [1] Breaks if the function is partitioned into two.

e.g:
---
void bug1513a()
{
 throw new Exception("d");
}

void bug1513()
{
try
{
try
{
bug1513a();
}
finally
{
   throw new Exception("f");
}
}
catch(Exception e)
{
assert(e.msg == "d");   // <-- Assertion failure here
assert(e.next.msg == "f");
assert(!e.next.next);
}
}
---

No combining happens because there are two LSDA's for bug1513().
---
_D4test7bug1513FZv:
  pushrbp
  mov rbp, rsp
  call_D4test8bug1513aFZv
  jmp .L5
//
// LSDA for bug1513()
//
_D4test7bug1513FZv.cold:
.L5:
...
//
// LSDA for bug1513.cold()
//
---



Line [2] breaks if one function is inlined into another.

e.g:
---
void test4()
{
void throw_catch()
{
try
{
throw new MyException;
}
catch (MyException)
{
}
catch (Exception)
{
assert(false);  // <-- Assertion failure here
}
}
try
{
try
{
throw new Exception("a");
}
finally
{
throw_catch();
}
}
catch(Exception e)
{
assert(e.msg == "a");
assert(!e.next);
}
}
---

The function throw_catch() is inlined into its parent, and so both now share
the same LSDA.  This means that the catch handler for MyException is now
ignored because there's already an in-flight Exception that takes precedence
because they appear to be thrown from the same function.

--


[Issue 17124] dmd segfaults on __traits(getMember, ...)

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17124

Heromyth  changed:

   What|Removed |Added

 CC||bitwo...@qq.com

--- Comment #5 from Heromyth  ---
See here: https://issues.dlang.org/show_bug.cgi?id=21008.

--


[Issue 21012] [REG2.062] Array equality fails with aggregates and > 3 levels of indirection

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21012

moonlightsenti...@disroot.org changed:

   What|Removed |Added

 Status|NEW |RESOLVED
 CC||moonlightsentinel@disroot.o
   ||rg
 Resolution|--- |WORKSFORME

--- Comment #1 from moonlightsenti...@disroot.org ---
Already fixed in master, bisection points to this PR
https://github.com/dlang/dmd/pull/11212

--


[Issue 11393] [GC] GC realloc and free don't ignore interior pointers

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=11393

--- Comment #5 from Dlang Bot  ---
dlang/druntime pull request #3149 "fix test for issue 11393 introduced by
#2436" was merged into master:

- d247d9636ca568b37d7995a253e525b41b6e2d38 by Rainer Schuetze:
  fix test for issue 11393

https://github.com/dlang/druntime/pull/3149

--


[Issue 17124] dmd segfaults on __traits(getMember, ...)

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17124

--- Comment #4 from zoujiaqing  ---
This issue needed : https://github.com/huntlabs/hunt-framework/issues/153

--


[Issue 17124] dmd segfaults on __traits(getMember, ...)

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=17124

zoujiaqing  changed:

   What|Removed |Added

 Status|RESOLVED|REOPENED
 CC||zoujiaq...@gmail.com
 Resolution|WORKSFORME  |---

--- Comment #3 from zoujiaqing  ---
how to fix it?

--


[Issue 21012] New: [REG2.062] Array equality fails with aggregates and > 3 levels of indirection

2020-07-05 Thread d-bugmail--- via Digitalmars-d-bugs
https://issues.dlang.org/show_bug.cgi?id=21012

  Issue ID: 21012
   Summary: [REG2.062] Array equality fails with aggregates and >
3 levels of indirection
   Product: D
   Version: D2
  Hardware: All
OS: All
Status: NEW
  Severity: regression
  Priority: P1
 Component: dmd
  Assignee: nob...@puremagic.com
  Reporter: pro.mathias.l...@gmail.com

```
struct Transaction
{
ubyte[] hash;
}

struct Block
{
Transaction[] txs;
}

void main ()
{
auto mutable = [ Block.init ];
immutable immut = [ Block.init ];
assert(mutable == immut);
}
```

Expected: Compiles, runs, succeeds
Got:
```
bug.d(16): Error: array equality comparison type mismatch, Block[] vs
immutable(Block[])
/usr/local/opt/dmd/include/dlang/dmd/core/internal/array/equality.d(127):
Error: array equality comparison type mismatch, Transaction[] vs
immutable(Transaction[])
bug.d(16): Error: template instance
core.internal.array.equality.__equals!(Block, immutable(Block)) error
instantiating
```

According to `run.dlang.org` it was working until v2.062.0

--