Bug 19704 – Segmentation fault in DMD

Status
RESOLVED
Resolution
WORKSFORME
Severity
major
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-02-27T03:29:37Z
Last change time
2020-03-21T03:56:32Z
Assigned to
No Owner
Creator
Victor Porton

Comments

Comment #0 by porton — 2019-02-27T03:29:37Z
$ dmd --version DMD64 D Compiler v2.084.1 Copyright (C) 1999-2018 by The D Language Foundation, All Rights Reserved written by Walter Bright $ dmd -unittest -c test.d test.d(14): Error: type int has no value Segmentation fault (core dumped) module test; private string ProviderParamsCode(Fields...)() { alias Types = stride!([Fields], 2); } mixin ProviderParamsCode!(int, "x", float, "y");
Comment #1 by uplink.coder — 2019-02-27T14:05:53Z
firstly the code above has to import std.range; which is missing from the code. the segfault is a null-pointer-deref inside the semantic handling of CondExp. (CondExp.econd == null) which happens because we try to run the semantic-routines on an invalid and therefore unexpected AST.
Comment #2 by razvan.nitu1305 — 2019-03-05T13:23:06Z
I cannot reproduce on Ubuntu 16.04 git HEAD.
Comment #3 by b2.temp — 2019-03-05T14:03:15Z
I've made a bugfix the other day that prevented this CondExp
Comment #4 by razvan.nitu1305 — 2019-03-05T14:04:35Z
(In reply to Basile-z from comment #3) > I've made a bugfix the other day that prevented this CondExp Great! Thank you!
Comment #5 by b2.temp — 2019-03-05T21:14:06Z
For reference it was this one https://github.com/dlang/dmd/pull/9404/files. Here `[Fields]` was causing the crash when DMD tried to find a common type.