Bug 20062 – Segfault on access to local func variable from element of dyn array of struct

Status
NEW
Severity
major
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2019-07-18T01:53:07Z
Last change time
2024-12-13T19:04:36Z
Keywords
wrong-code
Assigned to
No Owner
Creator
Alex
Moved to GitHub: dmd#19600 →

Comments

Comment #0 by alex — 2019-07-18T01:53:07Z
void main() { int g; struct A { bool a() { return (g == 0); } } auto b = new A[1]; b[0].a; } Segfaults at "return (g == 0);" on "gdc (Debian 8.3.0-6) 8.3.0" and on dlang.org online compiler, indicating a front end issue, so I reported it for dmd.
Comment #1 by b2.temp — 2019-11-03T13:01:54Z
It's indeed a FE e*problem but it's not an ICE, compilation succeeds.
Comment #2 by razvan.nitu1305 — 2023-04-18T11:50:51Z
It seems that the garbage collector lacks the information to properly set the context pointer.
Comment #3 by robert.schadek — 2024-12-13T19:04:36Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/dmd/issues/19600 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB