Skip to content

Commit 6d729ad

Browse files
committed
Fix issue #642.
The DMD source assumes that the statement of a FuncLiteralDeclaration is a CompoundStatement. But in this case it is a TryFinallyStatement. Therefore the assertion fails, causing the error. The code was fixed in DMD 2.066.
1 parent b7e83d3 commit 6d729ad

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

dmd2/func.c

+5
Original file line numberDiff line numberDiff line change
@@ -4174,9 +4174,14 @@ void FuncLiteralDeclaration::toCBuffer(OutBuffer *buf, HdrGenState *hgs)
41744174

41754175
CompoundStatement *cs = fbody->isCompoundStatement();
41764176
Statement *s1;
4177+
#if IN_LLVM // backport from DMD 2.066
4178+
if (semanticRun >= PASSsemantic3done && cs)
4179+
{
4180+
#else
41774181
if (semanticRun >= PASSsemantic3done)
41784182
{
41794183
assert(cs);
4184+
#endif
41804185
s1 = (*cs->statements)[cs->statements->dim - 1];
41814186
}
41824187
else

0 commit comments

Comments
 (0)