Bug 21936 – [REG 2.080.1] Segfault when compiled with -dip1000
Status
RESOLVED
Resolution
FIXED
Severity
regression
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2021-05-20T17:57:47Z
Last change time
2021-05-30T03:01:47Z
Keywords
pull
Assigned to
No Owner
Creator
uplink.coder
Comments
Comment #0 by uplink.coder — 2021-05-20T17:57:47Z
When the following code is compiled with -dip1000 the compiler segfaults.
struct Handlers {
void registerType(T)()
{
registerConstructors!T;
} void registerConstructors(T)()
{
constructImplicit!T;
}
}// Handlersauto constructImplicit(T)(T.init.tupleof)
{
}
import std.datetime;
void registerHandlersDateTime(Handlers handlers)
{
handlers.registerType!MonoTime;
}
The reason is that everything is marked @safe when compiled with -dip1000
causing setUnsafe to be called on a null pointer in dmd.access.checkAccess.
Comment #1 by uplink.coder — 2021-05-20T17:58:58Z
a crap.
Code example got in wrongly.
struct Handlers {
void registerType(T)()
{
registerConstructors!T;
} void registerConstructors(T)()
{
constructImplicit!T;
}
}
auto constructImplicit(T)(T.init.tupleof)
{
}
import std.datetime;
void registerHandlersDateTime(Handlers handlers)
{
handlers.registerType!MonoTime;
}
Comment #2 by dlang-bot — 2021-05-20T18:08:53Z
@UplinkCoder updated dlang/dmd pull request #12545 "Fix Issue 21212 - Segfault with -dip1000" fixing this issue:
- Fix Issue 21936 - Segfault with -dip1000
https://github.com/dlang/dmd/pull/12545
Comment #3 by dlang-bot — 2021-05-21T01:59:15Z
dlang/dmd pull request #12545 "Fix Issue 21936 - Segfault with -dip1000" was merged into stable:
- 0b1c91f32fde897029731574f3d4166c319df370 by Stefan Koch:
Fix Issue 21936 - Segfault with -dip1000
https://github.com/dlang/dmd/pull/12545
Comment #4 by dlang-bot — 2021-05-30T03:01:47Z
dlang/dmd pull request #12600 "merge stable" was merged into master:
- 4ce420989f9c748414bec04b561f45f5ba624c78 by Stefan Koch:
Fix Issue 21936 - Segfault with -dip1000
https://github.com/dlang/dmd/pull/12600