From da6ab01cbce6ba48efbb6a6dd4cf3875cc500fb1 Mon Sep 17 00:00:00 2001 From: Martin Nowak Date: Tue, 13 Feb 2018 16:33:28 +0100 Subject: [PATCH] zero class storage when initializer is null - all zero initializers are not stored in the typeinfo although classes currently always come with a non-zero vtable --- src/core/thread.d | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/core/thread.d b/src/core/thread.d index 400785740d..03aa36d401 100644 --- a/src/core/thread.d +++ b/src/core/thread.d @@ -2104,6 +2104,8 @@ extern (C) void thread_term() @nogc _d_monitordelete_nogc(Thread.sm_main); if (typeid(Thread).initializer.ptr) _mainThreadStore[] = typeid(Thread).initializer[]; + else + (cast(ubyte[])_mainThreadStore)[] = 0; Thread.sm_main = null; assert(Thread.sm_tbeg && Thread.sm_tlen == 1);