Skip to content

Commit 13e3686

Browse files
committed
Force reinterpret-cast to reverse the cast in FunctionDefinition.semantic.
With LDC 1.42.0, the direct cast from Statement to FunctionDefintion returns null, causing a segmentation fault later on. Casting to void* first forces a reinterpret cast and is symmetric with the code in FunctionDefinition.semantic().
1 parent f93cb97 commit 13e3686

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

engine/source/dmdscript/expression.d

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -608,7 +608,7 @@ class FunctionLiteral : Expression
608608

609609
override Expression semantic(Scope *sc)
610610
{
611-
func = cast(FunctionDefinition)(func.semantic(sc));
611+
func = cast(FunctionDefinition)cast(void*)func.semantic(sc);
612612
return this;
613613
}
614614

0 commit comments

Comments
 (0)