2
0
Эх сурвалжийг харах

Fixed AngelScript assert/crash if void value is attempted to be cast explicitly. Closes #33.

Lasse Öörni 12 жил өмнө
parent
commit
bdd2d03c81

+ 2 - 1
Source/ThirdParty/AngelScript/source/as_compiler.cpp

@@ -8148,7 +8148,8 @@ void asCCompiler::CompileConversion(asCScriptNode *node, asSExprContext *ctx)
 	// here we'll only treat those conversions that require an explicit cast.
 
 	bool conversionOK = false;
-	if( !expr.type.isConstant )
+	// Urho3D: check for void before attempting to compile the cast
+	if( !expr.type.isConstant && expr.type.dataType.GetTokenType() != ttVoid )
 	{
 		if( !expr.type.dataType.IsObject() )
 			ConvertToTempVariable(&expr);