D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 15875 - case of undetected circular reference in function parameter
Summary: case of undetected circular reference in function parameter
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: All All
: P1 normal
Assignee: No Owner
URL:
Keywords: ice, pull
Depends on:
Blocks:
 
Reported: 2016-04-04 23:06 UTC by Alex Parrill
Modified: 2020-03-21 03:56 UTC (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Alex Parrill 2016-04-04 23:06:07 UTC
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 Alex Parrill 2016-04-04 23:07:23 UTC
This code also has similar results:

    v o(int a[a])(){}
Comment 2 hsteoh 2016-09-02 17:32:11 UTC
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 basile-z 2019-02-16 04:15:34 UTC
pull : https://github.com/dlang/dmd/pull/9365
Comment 4 Dlang Bot 2019-02-16 05:17:58 UTC
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 Dlang Bot 2019-06-16 20:57:28 UTC
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