diff options
author | Thakee Nathees <thakeenathees@gmail.com> | 2020-12-27 11:27:50 +0530 |
---|---|---|
committer | Thakee Nathees <thakeenathees@gmail.com> | 2020-12-27 13:13:50 +0530 |
commit | ebade0e454282ccabb61335fb36c6416e3be314c (patch) | |
tree | 7a5d2c3ce24d19a49a435b36339ae116382a5292 /modules/gdscript/gdscript_analyzer.cpp | |
parent | 7d972b8c67412571e5ceb1d975aa5161e4e9e27b (diff) | |
download | redot-engine-ebade0e454282ccabb61335fb36c6416e3be314c.tar.gz |
GDScript assert message parsing bug fixed
Fix: #43540
Diffstat (limited to 'modules/gdscript/gdscript_analyzer.cpp')
-rw-r--r-- | modules/gdscript/gdscript_analyzer.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/modules/gdscript/gdscript_analyzer.cpp b/modules/gdscript/gdscript_analyzer.cpp index 19951ff17d..6a796fd047 100644 --- a/modules/gdscript/gdscript_analyzer.cpp +++ b/modules/gdscript/gdscript_analyzer.cpp @@ -1215,7 +1215,10 @@ void GDScriptAnalyzer::resolve_constant(GDScriptParser::ConstantNode *p_constant void GDScriptAnalyzer::resolve_assert(GDScriptParser::AssertNode *p_assert) { reduce_expression(p_assert->condition); if (p_assert->message != nullptr) { - reduce_literal(p_assert->message); + reduce_expression(p_assert->message); + if (!p_assert->message->is_constant || p_assert->message->reduced_value.get_type() != Variant::STRING) { + push_error(R"(Expected constant string for assert error message.)", p_assert->message); + } } p_assert->set_datatype(p_assert->condition->get_datatype()); |