From ef6161532dbd579fed2c537e76ff0ea60d32595c Mon Sep 17 00:00:00 2001 From: Yuri Roubinsky Date: Mon, 28 Oct 2019 08:35:33 +0300 Subject: [PATCH] Fix shader crash if non-boolean expression inserted into "if" --- servers/visual/shader_language.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/servers/visual/shader_language.cpp b/servers/visual/shader_language.cpp index 41a6b27b840..4e5e816c02d 100644 --- a/servers/visual/shader_language.cpp +++ b/servers/visual/shader_language.cpp @@ -4143,6 +4143,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Mapget_datatype() != TYPE_BOOL) { + _set_error("Expected boolean expression"); + return ERR_PARSE_ERROR; + } + tk = _get_token(); if (tk.type != TK_PARENTHESIS_CLOSE) { _set_error("Expected ')' after expression");