Skip to content

Commit

Permalink
Merge pull request #9109 from WalterBright/fix19491
Browse files Browse the repository at this point in the history
fix Issue 19491 - ICE (segfault) when initializing scope variable wit…
merged-on-behalf-of: Walter Bright <WalterBright@users.noreply.github.com>
  • Loading branch information
dlang-bot committed Dec 23, 2018
2 parents 5cb179f + 2d658b7 commit 57c8a5e
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/dmd/toctype.d
Expand Up @@ -260,7 +260,7 @@ public:

// Copy mutable version of backend type and add modifiers
type* mctype = Type_toCtype(t.castMod(0));
t.ctype = type_alloc(tybasic(mctype.Tty)); // pointer to class instance
t.ctype = type_allocn(tybasic(mctype.Tty), mctype.Tnext); // pointer to class instance
t.ctype.Tcount++;
addMod(t);
}
Expand Down
11 changes: 11 additions & 0 deletions test/compilable/test19491.d
@@ -0,0 +1,11 @@
// https://issues.dlang.org/show_bug.cgi?id=19491

class Foo
{
shared this();
}

void test()
{
scope foo = new shared Foo();
}

0 comments on commit 57c8a5e

Please sign in to comment.