summaryrefslogtreecommitdiff
path: root/core
diff options
context:
space:
mode:
authorsantouits <santouits@users.noreply.github.com>2018-10-28 12:13:39 +0200
committersantouits <santouits@users.noreply.github.com>2018-10-28 12:13:39 +0200
commitb0df0b46ac356f88639a6a195ab62fd1e6aaf57f (patch)
treeb6219664dd892578be544061abace3b59f06fc77 /core
parent7d296a638c693f0961f65c4af86c0cbc62c5bb50 (diff)
Error running Expression.execute after parse error
There happens a segmentation fault when you use Expression.parse() and you don't check for errors and then run Expression.execute(). So we check if there was a parse error in the execute method now.
Diffstat (limited to 'core')
-rw-r--r--core/math/expression.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/core/math/expression.cpp b/core/math/expression.cpp
index a16267cf0a..0cfb54234c 100644
--- a/core/math/expression.cpp
+++ b/core/math/expression.cpp
@@ -2120,6 +2120,10 @@ Error Expression::parse(const String &p_expression, const Vector<String> &p_inpu
}
Variant Expression::execute(Array p_inputs, Object *p_base, bool p_show_error) {
+ if (error_set) {
+ ERR_EXPLAIN("There was previously a parse error: " + error_str);
+ ERR_FAIL_V(Variant());
+ }
execution_error = false;
Variant output;