Bug 7503 – ICE(cgcs.c) "File[string]" associative array

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86_64
OS
Linux
Creation time
2012-02-14T09:37:00Z
Last change time
2013-09-07T10:06:57Z
Keywords
wrong-code
Assigned to
nobody
Creator
canidae

Comments

Comment #0 by canidae — 2012-02-14T09:37:40Z
naushika:~/tmp> dmd | head -1 DMD64 D Compiler v2.057 naushika:~/tmp> cat foo.d import std.stdio; File[string] files; void main() { files["test"] = File("test", "w"); files["test"].writeln("bar"); } naushika:~/tmp> dmd foo.d Internal error: ../ztc/cgcs.c 162 naushika:~/tmp> dmd foo.d -O naushika:~/tmp> ./foo object.Exception@std/stdio.d(1131): Enforcement failed ---------------- ./foo(pure @safe bool std.exception.enforce!(bool, "std/stdio.d", 1131).enforce(bool, lazy const(char)[])+0x45) [0x44e619] ./foo(std.stdio.File.LockingTextWriter std.stdio.File.LockingTextWriter.__ctor(ref std.stdio.File)+0x38) [0x44d9a8] ./foo(@property std.stdio.File.LockingTextWriter std.stdio.File.lockingTextWriter()+0x29) [0x44dad5] ./foo(void std.stdio.File.write!(immutable(char)[], char).write(immutable(char)[], char)+0x4e) [0x44752e] ./foo(void std.stdio.File.writeln!(immutable(char)[]).writeln(immutable(char)[])+0x47) [0x447453] ./foo(_Dmain+0x103) [0x4473ff] ./foo(extern (C) int rt.dmain2.main(int, char**).void runMain()+0x17) [0x44b4df] ./foo(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x2a) [0x44b086] ./foo(extern (C) int rt.dmain2.main(int, char**).void runAll()+0x42) [0x44b532] ./foo(extern (C) int rt.dmain2.main(int, char**).void tryExec(scope void delegate())+0x2a) [0x44b086] ./foo(main+0xd3) [0x44b017] /lib/x86_64-linux-gnu/libc.so.6(__libc_start_main+0xfd) [0x7f52232cbead] ----------------
Comment #1 by lovelydear — 2012-04-20T00:24:11Z
This one compiles on 2.059 Win32, but crashes with "Access violation" at runtime.
Comment #2 by hsteoh — 2013-08-15T10:16:10Z
Checked on git HEAD: the ICE no longer happens, but now a runtime exception is thrown: object.Exception@std/stdio.d(1442): Enforcement failed Looks like some kind of bad interaction with AA's and struct dtors.
Comment #3 by k.hara.pg — 2013-09-07T10:06:57Z
(In reply to comment #2) > Checked on git HEAD: the ICE no longer happens, but now a runtime exception is > thrown: > > object.Exception@std/stdio.d(1442): Enforcement failed > > Looks like some kind of bad interaction with AA's and struct dtors. The runtime exception is the dup of bug 6178. *** This issue has been marked as a duplicate of issue 6178 ***