Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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.102.0
v2.102.1-beta.1
6 changes: 4 additions & 2 deletions compiler/src/dmd/cparse.d
Original file line number Diff line number Diff line change
Expand Up @@ -1840,6 +1840,8 @@ final class CParser(AST) : Parser!AST
{
if (tt.id || tt.tok == TOK.enum_)
{
if (!tt.id && id)
tt.id = id;
Specifier spec;
auto stag = declareTag(tt, spec);
if (tt.tok == TOK.enum_)
Expand Down Expand Up @@ -3015,11 +3017,11 @@ final class CParser(AST) : Parser!AST
auto param = new AST.Parameter(specifiersToSTC(LVL.parameter, specifier),
t, id, null, null);
parameters.push(param);
if (token.value == TOK.rightParenthesis)
if (token.value == TOK.rightParenthesis || token.value == TOK.endOfFile)
break;
check(TOK.comma);
}
nextToken();
check(TOK.rightParenthesis);
return finish();
}

Expand Down
9 changes: 9 additions & 0 deletions compiler/src/dmd/expressionsem.d
Original file line number Diff line number Diff line change
Expand Up @@ -12098,6 +12098,15 @@ private extern (C++) final class ExpressionSemanticVisitor : Visitor
__equals = new DotIdExp(exp.loc, __equals, Id.object);
__equals = new DotIdExp(exp.loc, __equals, id);

/* https://issues.dlang.org/show_bug.cgi?id=23674
*
* Optimize before creating the call expression to the
* druntime hook as the optimizer may output errors
* that will get swallowed otherwise.
*/
exp.e1 = exp.e1.optimize(WANTvalue);
exp.e2 = exp.e2.optimize(WANTvalue);

auto arguments = new Expressions(2);
(*arguments)[0] = exp.e1;
(*arguments)[1] = exp.e2;
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/toobj.d
Original file line number Diff line number Diff line change
Expand Up @@ -580,7 +580,7 @@ void toObjFile(Dsymbol ds, bool multiobj)
vd.error("size overflow");
return;
}
if (sz64 >= target.maxStaticDataSize)
if (sz64 > target.maxStaticDataSize)
{
vd.error("size of 0x%llx exceeds max allowed size 0x%llx", sz64, target.maxStaticDataSize);
}
Expand Down
2 changes: 1 addition & 1 deletion compiler/src/dmd/typesem.d
Original file line number Diff line number Diff line change
Expand Up @@ -593,7 +593,7 @@ extern(C++) Type typeSemantic(Type type, const ref Loc loc, Scope* sc)
* run on them for the size, since they may be forward referenced.
*/
bool overflow = false;
if (mulu(tbn.size(loc), d2, overflow) >= target.maxStaticDataSize || overflow)
if (mulu(tbn.size(loc), d2, overflow) > target.maxStaticDataSize || overflow)
return overflowError();
}
}
Expand Down
6 changes: 6 additions & 0 deletions compiler/test/compilable/imports/imp23662.c
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
// https://issues.dlang.org/show_bug.cgi?id=23662
typedef enum {A} E;

E func(E v) {
return v;
}
8 changes: 8 additions & 0 deletions compiler/test/compilable/test23662.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
// https://issues.dlang.org/show_bug.cgi?id=23662
// EXTRA_FILES: imports/imp23662.c
import imports.imp23662;

void main(string[] args) {
auto r = func(A);
assert(r == A);
}
3 changes: 3 additions & 0 deletions compiler/test/compilable/test23679.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
// DISABLED: win32
// https://issues.dlang.org/show_bug.cgi?id=23679
ubyte [0x7fff_ffffU] arr;
8 changes: 8 additions & 0 deletions compiler/test/fail_compilation/test23672.i
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
/*
TEST_OUTPUT:
---
fail_compilation/test23672.i(9): Error: found `End of File` when expecting `)`
fail_compilation/test23672.i(9): Error: `=`, `;` or `,` expected to end declaration instead of `End of File`
---
*/
extern int feof (FILE *__strea
15 changes: 15 additions & 0 deletions compiler/test/fail_compilation/test23674.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// https://issues.dlang.org/show_bug.cgi?id=23674

/*
TEST_OUTPUT:
---
fail_compilation/test23674.d(14): Error: array index 2 is out of bounds `arr[0 .. 2]`
fail_compilation/test23674.d(14): Error: array index 3 is out of bounds `arr[0 .. 2]`
---
*/

void main()
{
string[2] arr;
assert(arr[2] == arr[3]);
}
2 changes: 1 addition & 1 deletion druntime/src/core/demangle.d
Original file line number Diff line number Diff line change
Expand Up @@ -2933,7 +2933,7 @@ CXX_DEMANGLER getCXXDemangler() nothrow @trusted
version (linux) import core.sys.linux.dlfcn : RTLD_DEFAULT;
version (NetBSD) import core.sys.netbsd.dlfcn : RTLD_DEFAULT;
version (OpenBSD) import core.sys.openbsd.dlfcn : RTLD_DEFAULT;
version (OSX) import core.sys.darwin.dlfcn : RTLD_DEFAULT;
version (Darwin) import core.sys.darwin.dlfcn : RTLD_DEFAULT;
version (Solaris) import core.sys.solaris.dlfcn : RTLD_DEFAULT;

if (auto found = cast(CXX_DEMANGLER) dlsym(RTLD_DEFAULT, "__cxa_demangle"))
Expand Down