1146 – mixin + assert() crashes compiler

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1146 - mixin + assert() crashes compiler
Summary: mixin + assert() crashes compiler
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D1 (retired)
Hardware: x86 All
: P3 normal
Assignee: Walter Bright
URL:
Keywords:
Depends on: 1159
Blocks:
Show dependency tree / graph
Reported: 2007年04月14日 15:56 UTC by David B. Held
Modified: 2014年02月16日 15:24 UTC (History)
0 users

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 David B. Held 2007年04月14日 15:56:38 UTC
The code below results in the compiler attempting to dereference a null pointer. I don't know if the code should be legal or not, but I'm pretty sure the compiler shouldn't crash either way.
emplate MetaString(String)
{
 alias String Value;
}
void main()
{
 alias MetaString!("2 == 1") S;
 assert(mixin(S.Value));
}
Comment 1 Thomas Kühne 2007年04月23日 12:54:29 UTC
"template MetaString(String)" expects String to be a type, "2 == 1" isn't a 
type thus the code is illegal.
Added to DStress as
http://dstress.kuehne.cn/nocompile/m/mixin_33_A.d
http://dstress.kuehne.cn/nocompile/m/mixin_33_B.d
http://dstress.kuehne.cn/nocompile/m/mixin_33_C.d 
Comment 2 Walter Bright 2007年04月27日 14:57:30 UTC
Fixed DMD 1.014


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