Bug 15875 – case of undetected circular reference in function parameter

Status
RESOLVED
Resolution
FIXED
Severity
normal
Priority
P1
Component
dmd
Product
D
Version
D2
Platform
All
OS
All
Creation time
2016-04-04T23:06:07Z
Last change time
2020-03-21T03:56:33Z
Keywords
ice, pull
Assigned to
No Owner
Creator
Alex Parrill

Comments

Comment #0 by initrd.gz — 2016-04-04T23:06:07Z
File contents: d o(int[a]a)(){} Compiling this with `dmd -c -o- /tmp/derr.d` with DMD 2.070.2 on x86-64 Linux causes DMD to pause for roughly two seconds, then exit with a segfault and no other output. Found by American Fuzzy Lop
Comment #1 by initrd.gz — 2016-04-04T23:07:23Z
This code also has similar results: v o(int a[a])(){}
Comment #2 by hsteoh — 2016-09-02T17:32:11Z
This is caused by an infinite recursion ddmd.mtype.semanticLength -> VarExp::semantic -> TypeAArray::semantic -> TypeSArray::semantic -> ddmd.mtype.semanticLength. Probably due to the construct `int[a] a` which depends upon itself.
Comment #3 by b2.temp — 2019-02-16T04:15:34Z
Comment #4 by dlang-bot — 2019-02-16T05:17:58Z
dlang/dmd pull request #9365 "fix issue 15875 - case of undetected circular reference in function parameter" was merged: https://github.com/dlang/dmd/pull/9365
Comment #5 by dlang-bot — 2019-06-16T20:57:28Z
dlang/dmd pull request #10046 "[dmd-cxx] Backport semanticRun refactoring and recursive semantic SEGV bug fixes" was merged into dmd-cxx: - d79274a3f3bef5873821f2017a13dff6ac6077a0 by Basile Burg: fix issue 15875 - case of undetected circular reference in function parameter https://github.com/dlang/dmd/pull/10046