Skip to content

Commit

Permalink
Merge pull request #9075 from RazvanN7/Issue_18938
Browse files Browse the repository at this point in the history
Fix Issue 18938 - Dmd segfault when compiling this dub package in test release
  • Loading branch information
WalterBright committed Dec 15, 2018
2 parents 883b593 + 19f49cf commit e4aee58
Show file tree
Hide file tree
Showing 5 changed files with 53 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/dmd/glue.d
Expand Up @@ -402,8 +402,9 @@ void genObjFile(Module m, bool multiobj)
m.covb = cast(uint *)calloc((m.numlines + 32) / 32, (*m.covb).sizeof);
}

foreach (member; *m.members)
for (int i = 0; i < m.members.dim; i++)
{
auto member = (*m.members)[i];
//printf("toObjFile %s %s\n", member.kind(), member.toChars());
toObjFile(member, multiobj);
}
Expand Down
10 changes: 10 additions & 0 deletions test/fail_compilation/fail18938.d
@@ -0,0 +1,10 @@
// REQUIRED_ARGS: -c -Ifail_compilation/imports/ fail_compilation/imports/test18938a/cache.d fail_compilation/imports/test18938a/file.d
/*
TEST_OUTPUT:
---
fail_compilation/imports/test18938b/file.d(20): Deprecation: `std.algorithm.setops.No` is not visible from module `file`
fail_compilation/imports/test18938b/file.d(9): Error: `map(Range)(Range r) if (isInputRange!(Unqual!Range))` has no effect
---
*/

void main() {}
Empty file.
13 changes: 13 additions & 0 deletions test/fail_compilation/imports/test18938a/file.d
@@ -0,0 +1,13 @@
import imports.test18938b.file;
class IconThemeGroup : IniLikeGroup
{
this()
{
super("Icon Theme");
}

///setter
string inherits()() {
}

}
28 changes: 28 additions & 0 deletions test/fail_compilation/imports/test18938b/file.d
@@ -0,0 +1,28 @@
module imports.test18938b.file;
import std.algorithm;

class IniLikeGroup
{
this(string ) {}
@trusted byNode()
{
map!(node => lineNode);
}
}


class IniLikeFile
{
struct WriteOptions
{
static exact()
{
return WriteOptions(No.lineBetweenGroups);
}

this(Args)(Args ){}

}
void saveToFile(WriteOptions = WriteOptions.exact) {}
final save() {}
}

0 comments on commit e4aee58

Please sign in to comment.