Bug 1518 – Crash using 'scope', 'with' and undefined 'RegExp'
Status
RESOLVED
Resolution
FIXED
Severity
critical
Priority
P2
Component
dmd
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2007-09-19T09:02:00Z
Last change time
2015-06-09T01:14:16Z
Keywords
ice-on-invalid-code
Assigned to
bugzilla
Creator
regan
Comments
Comment #0 by regan — 2007-09-19T09:02:51Z
//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>
a patch to fix
statement.c 3213
int TryFinallyStatement::fallOffEnd()
{
if (body)
return body->fallOffEnd();
else
return TRUE;
}
Comment #3 by kamm-removethis — 2008-07-13T01:44:25Z
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.