From 1cf34a15e7ea7c363cb9578ac043e24ec856caf3 Mon Sep 17 00:00:00 2001 From: Niels Martin Hansen Date: Wed, 14 Nov 2007 20:44:47 +0000 Subject: [PATCH] Fix bug in 'ifgtz' and 'ifeqz' functions in RPN expression engine: they didn't check for the correct number of parameters, and caused a nasty crash as a result, if the number passed was wrong. Originally committed to SVN as r1653. --- OverLua/expression_engine.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/OverLua/expression_engine.cpp b/OverLua/expression_engine.cpp index 89830d185..86191ed0e 100644 --- a/OverLua/expression_engine.cpp +++ b/OverLua/expression_engine.cpp @@ -263,7 +263,7 @@ namespace ExpressionEngine { static bool f_ifgtz(Stack &stack, void *data) { - if (stack.size() >= 2) { + if (stack.size() >= 3) { double v1 = stack.back(); stack.pop_back(); double v2 = stack.back(); @@ -283,7 +283,7 @@ namespace ExpressionEngine { static bool f_ifeqz(Stack &stack, void *data) { - if (stack.size() >= 2) { + if (stack.size() >= 3) { double v1 = stack.back(); stack.pop_back(); double v2 = stack.back();