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
4 changes: 3 additions & 1 deletion src/statement.d
Original file line number Diff line number Diff line change
Expand Up @@ -192,7 +192,9 @@ public:
// Same as semanticNoScope(), but do create a new scope
final Statement semanticScope(Scope* sc, Statement sbreak, Statement scontinue)
{
Scope* scd = sc.push();
auto sym = new ScopeDsymbol();
sym.parent = sc.scopesym;
Scope* scd = sc.push(sym);
if (sbreak)
scd.sbreak = sbreak;
if (scontinue)
Expand Down
6 changes: 6 additions & 0 deletions test/compilable/imports/test16348.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
module mypackage.bar;

package bool bar()
{
return false;
}
13 changes: 13 additions & 0 deletions test/compilable/test16348.d
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
// EXTRA_SOURCES: imports/test16348.d
module mypackage.foo;

void bug()
{
// removing the if-else also removes the segfault
if (true) {}
else
{
import mypackage.bar;
auto b = bar();
}
}