1269 – Compiler crash on assigning to an element of a void-initialized array in CTFE

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1269 - Compiler crash on assigning to an element of a void-initialized array in CTFE
Summary: Compiler crash on assigning to an element of a void-initialized array in CTFE
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 Windows
: P2 normal
Assignee: Walter Bright
URL:
Keywords: ice-on-valid-code
Depends on:
Blocks:
Reported: 2007年06月16日 08:44 UTC by Jascha Wetzel
Modified: 2014年02月16日 15:25 UTC (History)
1 user (show)

See Also:


Attachments
Add an attachment (proposed patch, testcase, etc.)

Note You need to log in before you can comment on or make changes to this issue.
Description Jascha Wetzel 2007年06月16日 08:44:42 UTC
import std.string;
const uint VERSION_MAJOR = 0,
 VERSION_MINOR = 10,
 VERSION_PATCH = 2;
const char[]	VERSION_STRING = "Ddbg "~.toString(VERSION_MAJOR)~"."~(VERSION_MINOR>9?"":"0")~.toString(VERSION_MINOR)
 ~(VERSION_PATCH>0?"."~.toString(VERSION_PATCH):"")~" beta";
void main() {}
Comment 1 Matti Niemenmaa 2007年06月16日 09:14:04 UTC
Brought it down to this, nothing to do with strings but rather with the attempted and failing CTFE of toString (here simplified and renamed f):
int f() {
	// this also causes the crash:
	// int[] a = void;
	int[1] a = void;
	a[0] = 1;
	return 1;
}
const i = f();
It's probably dependent on Issue 1254, but they're subtly different so I won't set it as a dependency.
Comment 2 Matti Niemenmaa 2007年06月26日 14:32:50 UTC
Fixed in DMD 1.017.


AltStyle によって変換されたページ (->オリジナル) /