tinyexpr: Check for null-pointer

This commit is contained in:
Fabian Homborg 2021-09-10 20:06:03 +02:00
parent e38de3df64
commit 4c5d586249

View File

@ -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;