You've already forked godot
mirror of
https://github.com/godotengine/godot.git
synced 2025-11-07 12:30:27 +00:00
Fix shader crash if non-boolean expression inserted into "if"
This commit is contained in:
@@ -4143,6 +4143,11 @@ Error ShaderLanguage::_parse_block(BlockNode *p_block, const Map<StringName, Bui
|
|||||||
if (!n)
|
if (!n)
|
||||||
return ERR_PARSE_ERROR;
|
return ERR_PARSE_ERROR;
|
||||||
|
|
||||||
|
if (n->get_datatype() != TYPE_BOOL) {
|
||||||
|
_set_error("Expected boolean expression");
|
||||||
|
return ERR_PARSE_ERROR;
|
||||||
|
}
|
||||||
|
|
||||||
tk = _get_token();
|
tk = _get_token();
|
||||||
if (tk.type != TK_PARENTHESIS_CLOSE) {
|
if (tk.type != TK_PARENTHESIS_CLOSE) {
|
||||||
_set_error("Expected ')' after expression");
|
_set_error("Expected ')' after expression");
|
||||||
|
|||||||
Reference in New Issue
Block a user