D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 6556 - ICE for ImportStatement in DebugStatement
Summary: ICE for ImportStatement in DebugStatement
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: Other FreeBSD
: P2 normal
Assignee: No Owner
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
 
Reported: 2011-08-25 18:51 UTC by Martin Nowak
Modified: 2011-08-28 00:51 UTC (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description Martin Nowak 2011-08-25 18:51:20 UTC
debug=BUG;
void foo() {
  debug(BUG) import anything;
}

---

Import::semantic is assuming that the scope has a scope symbol and
calls importScope on it. It segfaults because debug create a new scope
without symbol. The correct fix seems to be calling importScope on the first
enclosing scope that has a symbol. That way it behaves as Scope::insert(Dsymbol*).