1518 – Crash using 'scope', 'with' and undefined 'RegExp'

D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 1518 - Crash using 'scope', 'with' and undefined 'RegExp'
Summary: Crash using 'scope', 'with' and undefined 'RegExp'
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: dmd (show other issues)
Version: D2
Hardware: x86 All
: P2 critical
Assignee: Walter Bright
URL:
Keywords: ice-on-invalid-code
Depends on:
Blocks:
Reported: 2007年09月19日 09:02 UTC by Regan Heath
Modified: 2015年06月09日 01:14 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 Regan Heath 2007年09月19日 09:02:51 UTC
//Compiling this results in a DMD crash.
void main()
{
	int i;
	scope(exit) i++;
	with(new RegExp(``)) {}
}
E:\D\src\tmp>dmd -v bug002.d
parse bug002
semantic bug002
import object (E:\D\dmd\bin\..\src\phobos\object.d)
semantic2 bug002
semantic3 bug002
bug002.d(5): Error: identifier 'RegExp' is not defined
bug002.d(5): Error: RegExp is used as a type
bug002.d(5): Error: new can only create structs, dynamic arrays or class objects
, not void's
bug002.d(5): Error: with expressions must be class objects, not 'void*'
<crash>
Comment 2 david 2007年11月08日 20:49:23 UTC
a patch to fix
statement.c 3213
int TryFinallyStatement::fallOffEnd()
{ 
 if (body)
 return body->fallOffEnd();
 else
 return TRUE;
}
Comment 3 Christian Kamm 2008年07月13日 01:44:25 UTC
This error had been fixed in DMD 1.029 or before by applying the patch. 
A version between 1.030 and 1.033 has introduced the regression that http://dstress.kuehne.cn/nocompile/s/scope_19_B.d segfaults on invalid again.
Comment 4 Walter Bright 2008年12月25日 04:37:14 UTC
Fixed dmd 1.038 amd 2.022


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