Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
55 commits
Select commit Hold shift + click to select a range
5384aee
fix issue 19295 - ICE when taking address of member function passed a…
Jul 2, 2019
38a84b5
Merge pull request #10123 from Basile-z/issue-19295
thewilsonator Jul 3, 2019
ba52a8f
Fix issue 20022: [POSIX] extern(C++, "namespace") does not apply name…
Geod24 Jul 3, 2019
8148f6d
Merge pull request #10127 from Geod24/fix-20022
thewilsonator Jul 3, 2019
dde9964
Fix Issue 20025 - alias this combined with a copy constructor seems t…
RazvanN7 Jul 4, 2019
8c27bbe
Merge pull request #10137 from RazvanN7/Issue_20025
dlang-bot Jul 4, 2019
45883b8
Fix typo in dmd.func.setUnsafe description
lesderid Jul 4, 2019
2241982
Merge pull request #10138 from lesderid/fix-setUnsafe-typo
WalterBright Jul 4, 2019
4b8438a
Fix issue 17885: use the correct expression's type when creating temp…
FeepingCreature Jul 5, 2019
f811228
Merge pull request #10140 from FeepingCreature/fix/issue-17885-backen…
dlang-bot Jul 5, 2019
caf888b
fix issue 19708 - Can't use __traits(getAttributes, ...)[...] as a type
Jul 6, 2019
aa2d70b
Merge pull request #10144 from Basile-z/issue-19708-alt
dlang-bot Jul 6, 2019
f9858a3
remove field to match a recent change in mtype.d
Jul 6, 2019
c57c887
Merge pull request #10145 from Basile-z/fixup-ast-base
dlang-bot Jul 6, 2019
44469ba
fix issue 20011, 17828 - crash or accept write operation on members o…
Jun 30, 2019
f905713
Merge pull request #10115 from Basile-z/issue-20011-17828
dlang-bot Jul 7, 2019
e9b518c
Fix bug 20035 - segfault in vcg-ast (#10155)
UplinkCoder Jul 10, 2019
fa3fd10
use same limit on debug record length in debug and release builds, do…
rainers Jul 10, 2019
25ba318
Merge pull request #10158 from rainers/cv_debug_assert
dlang-bot Jul 10, 2019
fca2b02
Fix issue 20039: when checking for an existing template instance, tol…
FeepingCreature Jul 10, 2019
00a3035
Merge pull request #10159 from FeepingCreature/fix/issue-20039
dlang-bot Jul 10, 2019
2646418
fix debug assertion for C++ dtor
rainers Jul 10, 2019
ea6bc80
Merge pull request #10156 from rainers/cpp_debug_assert
dlang-bot Jul 11, 2019
02df7b3
fix issue 20042 - __vector CTFE crashes the compiler (#10160)
Jul 11, 2019
905789d
insidx: fix naked asm in debug builds
rainers Jul 12, 2019
8ad3f43
fix issue 20044 - Compiler crash when using an opaque struct as templ…
Jul 14, 2019
7bdcec4
fix issue 20045 - bogus error: "integer constant expression expected …
Jul 14, 2019
4f34502
Merge pull request #10174 from Basile-z/issue-20045
dlang-bot Jul 15, 2019
0d4098b
Merge pull request #10173 from Basile-z/issue-20044
dlang-bot Jul 15, 2019
b561bf5
Fix issue 20052 - SIMD 32 bytes segfault (#10178)
SSoulaimane Jul 15, 2019
a40a6f8
Fix Issue 20051 - ICE in func literal used in __traits(compiles)
RazvanN7 Jul 16, 2019
b6ca1a5
Merge pull request #10186 from RazvanN7/Issue_20051
dlang-bot Jul 16, 2019
2717993
fix issue 20056 - DMD Segfault in 2.087
Jul 16, 2019
b95197f
Merge pull request #10187 from Basile-z/issue-20056
dlang-bot Jul 16, 2019
40d6c40
Fix Issue 930 - Templates inside templates used as mixins
RazvanN7 Jul 17, 2019
9f3c29a
Merge pull request #10192 from RazvanN7/Issue_930
dlang-bot Jul 18, 2019
9cd97ab
fix issue 19950 - access violation at compile time, possibly via temp…
Jul 18, 2019
f8f8a6c
Merge pull request #10195 from Basile-z/stable
dlang-bot Jul 19, 2019
127fc3f
Fix issue 20063 - Patch closure variables when converting expressions…
SSoulaimane Jul 18, 2019
7600fe8
Merge pull request #10196 from SSoulaimane/fix20063
dlang-bot Jul 19, 2019
f93ec13
fix issue 11856 - segfault with circular template constraints
Jul 21, 2019
e845220
Merge pull request #10205 from Basile-z/issue-11856
dlang-bot Jul 21, 2019
d8a845e
add missing c++ headers change from #10205
Jul 21, 2019
2c28c66
fix issue 20067 - [REG2.086] foreach no longer works on range with al…
Jul 21, 2019
1fb77d0
Merge pull request #10207 from Basile-z/issue-11856-header
dlang-bot Jul 21, 2019
c48b290
Fix issue 20065: support empty AliasSeq tuples in compiletime array l…
FeepingCreature Jul 22, 2019
e22c733
Merge pull request #10206 from Basile-z/issue-20067
dlang-bot Jul 23, 2019
b826d5a
fix issue Issue 20072 - [2.087.0] Mixin templates: no property `somev…
tgehr Jul 24, 2019
6f5d87a
Merge pull request #10214 from tgehr/fix20072
thewilsonator Jul 24, 2019
0b4a3a3
Revert "Fix Issue 19754 - cast() sometimes yields lvalue, sometimes y…
kinke Jul 26, 2019
121b29b
redo fix for issue 11856: segfault with circular template constraints
rainers Jul 29, 2019
307684d
Merge pull request #10220 from kinke/revert9505
RazvanN7 Jul 29, 2019
9cd9501
Merge pull request #10239 from rainers/refix11856
dlang-bot Jul 29, 2019
378312c
bump VERSION to v2.087.1-beta.1
MartinNowak Jul 31, 2019
ccf5939
Merge remote-tracking branch 'upstream/stable' into merge_stable
MartinNowak Jul 31, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
v2.087.0
v2.087.1-beta.1
3 changes: 2 additions & 1 deletion src/dmd/access.d
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ bool checkAccess(AggregateDeclaration ad, Loc loc, Scope* sc, Dsymbol smember)
printf("AggregateDeclaration::checkAccess() for %s.%s in function %s() in scope %s\n", ad.toChars(), smember.toChars(), f ? f.toChars() : null, cdscope ? cdscope.toChars() : null);
}

if (smember.toParent().isTemplateInstance())
const p = smember.toParent();
if (p && p.isTemplateInstance())
{
return false; // for backward compatibility
}
Expand Down
17 changes: 10 additions & 7 deletions src/dmd/aggregate.d
Original file line number Diff line number Diff line change
Expand Up @@ -217,17 +217,20 @@ extern (C++) abstract class AggregateDeclaration : ScopeDsymbol
return 0;
}

for (size_t i = 0; i < members.dim; i++)
if (members)
{
auto s = (*members)[i];
if (s.apply(&func, cast(void*)this))
for (size_t i = 0; i < members.dim; i++)
{
if (sizeok != Sizeok.none)
auto s = (*members)[i];
if (s.apply(&func, cast(void*)this))
{
// recursive determineFields already finished
return true;
if (sizeok != Sizeok.none)
{
// recursive determineFields already finished
return true;
}
return false;
}
return false;
}
}

Expand Down
1 change: 0 additions & 1 deletion src/dmd/astbase.d
Original file line number Diff line number Diff line change
Expand Up @@ -4202,7 +4202,6 @@ struct ASTBase
{
TraitsExp exp;
Loc loc;
bool inAliasDeclaration;

extern (D) this(const ref Loc loc, TraitsExp exp)
{
Expand Down
64 changes: 37 additions & 27 deletions src/dmd/backend/cgcod.d
Original file line number Diff line number Diff line change
Expand Up @@ -290,32 +290,6 @@ tryagain:
regcon.params &= ~noparams;
}

// See if we need to enforce a particular stack alignment
foreach (i; 0 .. globsym.top)
{
Symbol *s = globsym.tab[i];

switch (s.Sclass)
{
case SCregister:
case SCauto:
case SCfastpar:
if (s.Sfl == FLreg)
break;

const sz = type_alignsize(s.Stype);
if (sz > STACKALIGN && (I64 || config.exe == EX_OSX))
{
STACKALIGN = sz;
enforcealign = true;
}
break;

default:
break;
}
}

if (config.flags4 & CFG4optimized)
{
if (nretblocks == 0 && // if no return blocks in function
Expand Down Expand Up @@ -375,6 +349,35 @@ tryagain:
cgcod_eh();
}

// See if we need to enforce a particular stack alignment
foreach (i; 0 .. globsym.top)
{
Symbol *s = globsym.tab[i];

if (Symbol_Sisdead(s, anyiasm))
continue;

switch (s.Sclass)
{
case SCregister:
case SCauto:
case SCfastpar:
if (s.Sfl == FLreg)
break;

const sz = type_alignsize(s.Stype);
if (sz > STACKALIGN && (I64 || config.exe == EX_OSX))
{
STACKALIGN = sz;
enforcealign = true;
}
break;

default:
break;
}
}

stackoffsets(1); // compute addresses of stack variables
cod5_prol_epi(); // see where to place prolog/epilog
CSE.finish(); // compute addresses and sizes of CSE saves
Expand Down Expand Up @@ -995,7 +998,14 @@ else
}

/* Determine if we need BP set up */
if (config.flags & CFGalwaysframe)
if (enforcealign)
{
// we need BP to reset the stack before return
// otherwise the return address is lost
needframe = 1;

}
else if (config.flags & CFGalwaysframe)
needframe = 1;
else
{
Expand Down
22 changes: 5 additions & 17 deletions src/dmd/backend/cgobj.d
Original file line number Diff line number Diff line change
Expand Up @@ -460,24 +460,12 @@ version (X86ASM)
{
int insidx(char *p,uint index)
{
// https://issues.dlang.org/show_bug.cgi?id=19974
static if (__VERSION__ >= 2086)
asm
{
naked ;
mov EAX,index - [ESP] ;
mov ECX,p - [ESP] ;
}
else
asm nothrow
{
naked ;
mov EAX,index - [ESP+4] ;
mov ECX,p - [ESP+4] ;
}

asm nothrow
asm
{
naked ;
mov EAX,[ESP+8] ; // index
mov ECX,[ESP+4] ; // p

cmp EAX,0x7F ;
jae L1 ;
mov [ECX],AL ;
Expand Down
2 changes: 1 addition & 1 deletion src/dmd/backend/cod3.d
Original file line number Diff line number Diff line change
Expand Up @@ -4187,7 +4187,7 @@ void epilog(block *b)
{
L4:
assert(hasframe);
if (xlocalsize)
if (xlocalsize || enforcealign)
{
if (config.flags2 & CFG2stomp)
{ /* MOV ECX,0xBEAF
Expand Down
7 changes: 3 additions & 4 deletions src/dmd/backend/dcgcv.d
Original file line number Diff line number Diff line change
Expand Up @@ -244,17 +244,16 @@ debtyp_t * debtyp_alloc(uint length)
length += pad;
}

length < 0x10000 || assert(0);
const len = debtyp_t.sizeof - (d.data).sizeof + length;
debug
{
const len = debtyp_t.sizeof - (d.data).sizeof + length;
assert(len < 4 * 4096 - 100);
d = cast(debtyp_t *) mem_malloc(len /*+ 1*/);
memset(d, 0xAA, len);
// (cast(char*)d)[len] = 0x2E;
}
else
{
assert(length < 0x10000);
d = cast(debtyp_t *) malloc(debtyp_t.sizeof - (d.data).sizeof + length);
}
d.length = cast(ushort)length;
Expand All @@ -277,8 +276,8 @@ private void debtyp_free(debtyp_t *d)
//fflush(stdout);
debug
{
assert(d.length < 0x10000);
uint len = debtyp_t.sizeof - (d.data).sizeof + d.length;
assert(len < 4 * 4096 - 100);
// assert((cast(char*)d)[len] == 0x2E);
memset(d, 0x55, len);
mem_free(d);
Expand Down
2 changes: 2 additions & 0 deletions src/dmd/ctfeexpr.d
Original file line number Diff line number Diff line change
Expand Up @@ -1835,6 +1835,8 @@ bool isCtfeValueValid(Expression newval)
return true; //((StructLiteralExp *)newval)->ownedByCtfe;
if (newval.op == TOK.classReference)
return true;
if (newval.op == TOK.type)
return true;
if (newval.op == TOK.vector)
return true; // vector literal
if (newval.op == TOK.function_)
Expand Down
25 changes: 22 additions & 3 deletions src/dmd/delegatize.d
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,25 @@ private void lambdaSetParent(Expression e, FuncDeclaration fd)
alias visit = typeof(super).visit;
FuncDeclaration fd;

private void setParent(Dsymbol s)
{
VarDeclaration vd = s.isVarDeclaration();
FuncDeclaration pfd = s.parent ? s.parent.isFuncDeclaration() : null;
s.parent = fd;
if (!vd || !pfd)
return;
// move to fd's closure when applicable
foreach (i; 0 .. pfd.closureVars.dim)
{
if (vd == pfd.closureVars[i])
{
pfd.closureVars.remove(i);
fd.closureVars.push(vd);
break;
}
}
}

public:
extern (D) this(FuncDeclaration fd)
{
Expand All @@ -98,7 +117,7 @@ private void lambdaSetParent(Expression e, FuncDeclaration fd)

override void visit(DeclarationExp e)
{
e.declaration.parent = fd;
setParent(e.declaration);
e.declaration.accept(this);
}

Expand All @@ -107,7 +126,7 @@ private void lambdaSetParent(Expression e, FuncDeclaration fd)
if (e.lengthVar)
{
//printf("lengthVar\n");
e.lengthVar.parent = fd;
setParent(e.lengthVar);
e.lengthVar.accept(this);
}
}
Expand All @@ -117,7 +136,7 @@ private void lambdaSetParent(Expression e, FuncDeclaration fd)
if (e.lengthVar)
{
//printf("lengthVar\n");
e.lengthVar.parent = fd;
setParent(e.lengthVar);
e.lengthVar.accept(this);
}
}
Expand Down
23 changes: 20 additions & 3 deletions src/dmd/dinterpret.d
Original file line number Diff line number Diff line change
Expand Up @@ -2029,12 +2029,21 @@ public:
{
printf("%s Expression::interpret() '%s' %s\n", e.loc.toChars(), Token.toChars(e.op), e.toChars());
printf("type = %s\n", e.type.toChars());
e.print();
showCtfeExpr(e);
}
e.error("cannot interpret `%s` at compile time", e.toChars());
result = CTFEExp.cantexp;
}

override void visit(TypeExp e)
{
debug (LOG)
{
printf("%s TypeExp.interpret() %s\n", e.loc.toChars(), e.toChars());
}
result = e;
}

override void visit(ThisExp e)
{
debug (LOG)
Expand Down Expand Up @@ -2076,7 +2085,7 @@ public:
}
return;
}
assert(result.op == TOK.structLiteral || result.op == TOK.classReference);
assert(result.op == TOK.structLiteral || result.op == TOK.classReference || result.op == TOK.type);
return;
}
e.error("value of `this` is not known at compile time");
Expand Down Expand Up @@ -4262,6 +4271,13 @@ public:
lowerbound = 0;
upperbound = 0;
}
else if (VectorExp ve = e1.isVectorExp())
{
// ve is not handled but a proper error message is returned
// this is to prevent https://issues.dlang.org/show_bug.cgi?id=20042
lowerbound = 0;
upperbound = ve.dim;
}
else
assert(0);

Expand Down Expand Up @@ -5077,7 +5093,8 @@ public:
result = CTFEExp.cantexp;
return;
}
assert(pthis.op == TOK.structLiteral || pthis.op == TOK.classReference);

assert(pthis.op == TOK.structLiteral || pthis.op == TOK.classReference || pthis.op == TOK.type);

if (fd.isVirtual() && !e.directcall)
{
Expand Down
1 change: 1 addition & 0 deletions src/dmd/dscope.d
Original file line number Diff line number Diff line change
Expand Up @@ -60,6 +60,7 @@ enum SCOPE
free = 0x8000, /// is on free list

fullinst = 0x10000, /// fully instantiate templates
alias_ = 0x20000, /// inside alias declaration.
}

// Flags that are carried along with a scope push()
Expand Down
4 changes: 2 additions & 2 deletions src/dmd/dsymbol.d
Original file line number Diff line number Diff line change
Expand Up @@ -441,7 +441,7 @@ extern (C++) class Dsymbol : ASTNode
final inout(Dsymbol) pastMixin() inout
{
//printf("Dsymbol::pastMixin() %s\n", toChars());
if (!isTemplateMixin() && !isForwardingAttribDeclaration())
if (!isTemplateMixin() && !isForwardingAttribDeclaration() && !isForwardingScopeDsymbol())
return this;
if (!parent)
return null;
Expand Down Expand Up @@ -494,7 +494,7 @@ extern (C++) class Dsymbol : ASTNode
/// ditto
final inout(Dsymbol) toParent2() inout
{
if (!parent || !parent.isTemplateInstance && !parent.isForwardingAttribDeclaration())
if (!parent || !parent.isTemplateInstance && !parent.isForwardingAttribDeclaration() && !parent.isForwardingScopeDsymbol())
return parent;
return parent.toParent2;
}
Expand Down
Loading