From 4c5d586249d390c8b4f1738e60f4d65776b748e8 Mon Sep 17 00:00:00 2001 From: Fabian Homborg Date: Fri, 10 Sep 2021 20:06:03 +0200 Subject: [PATCH] tinyexpr: Check for null-pointer --- src/tinyexpr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tinyexpr.cpp b/src/tinyexpr.cpp index fe226781d..1d0d7bcc5 100644 --- a/src/tinyexpr.cpp +++ b/src/tinyexpr.cpp @@ -586,7 +586,7 @@ double te_eval(const te_expr *n) { static void optimize(te_expr *n) { /* Evaluates as much as possible. */ - if (n->type == TE_CONSTANT) return; + if (!n || n->type == TE_CONSTANT) return; const int arity = get_arity(n->type); bool known = true;