3196 – Segfault(mtype.c) after almost any error involving a delegate literal

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3196 - Segfault(mtype.c) after almost any error involving a delegate literal
Summary: Segfault(mtype.c) after almost any error involving a delegate literal
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P2 regression
Assignee: No Owner
URL:
Keywords: ice-on-invalid-code
: 3227 3228 (view as issue list)
Depends on:
Blocks:
Reported: 2009年07月20日 16:11 UTC by lifc0@yahoo.com.cn
Modified: 2015年06月09日 01:28 UTC (History)
3 users (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 lifc0@yahoo.com.cn 2009年07月20日 16:11:30 UTC
Try this on both linux and windows with dmd 2.031 give me a segment fault because of a null pointer reference.
struct Foo {
}
void foo (Foo b, void delegate ()) {
}
void main () {
	foo(Foo(1), (){});
}
Comment 1 Don 2009年08月05日 01:01:53 UTC
Bug #3227 and bug #3228 are probably duplicates of this one.
Comment 2 Don 2009年08月06日 00:00:22 UTC
Original title:
"Bad struct declaration before a anonymous delegate within the parameter list show a segment fault" It's actually a lot more general than that. And it's a regression.
Another example from bug #3227:
auto x = (void){};
----
ice.d(1): Error: cannot have parameter of type void
ice.d(1): Error: cannot have parameter of type void
<segfault>
Other examples from bug #3228:
void main(){ (){}; (){}; }
ice.d(1): Error: function has no effect in expression (__dgliteral1)
<segfault>
This smiley variant should compile without errors. But it just segfaults.
---
static assert(!is(typeof((){(){}
 ;-()
{};})));
Comment 3 Don 2009年08月06日 00:00:57 UTC
*** Issue 3227 has been marked as a duplicate of this issue. ***
Comment 4 Don 2009年08月06日 00:01:17 UTC
*** Issue 3228 has been marked as a duplicate of this issue. ***
Comment 5 Walter Bright 2009年09月03日 13:27:18 UTC
Fixed dmd 1.047 and 2.032


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