From 26d4df32d40e8c6e327449f926f3cef651949a7d Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Tue, 4 Feb 2014 20:21:51 -0600 Subject: [PATCH] Fix constant < > <= >= evaluation - SendExprCommand() evaluated all four of these as their inverse. I wouldn't at all be surprised if this was caused by me fixing the undefined behavior (Which PopExStk() is called first?) and not even noticing that these were reversed because they popped off the stack in reverse order. --- parse.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/parse.c b/parse.c index e6d63f0..09c14b4 100644 --- a/parse.c +++ b/parse.c @@ -3806,19 +3806,19 @@ static void SendExprCommand(pcd_t pcd) break; case PCD_LT: operand2 = PopExStk(); - PushExStk(PopExStk() >= operand2); + PushExStk(PopExStk() < operand2); break; case PCD_GT: operand2 = PopExStk(); - PushExStk(PopExStk() <= operand2); + PushExStk(PopExStk() > operand2); break; case PCD_LE: operand2 = PopExStk(); - PushExStk(PopExStk() > operand2); + PushExStk(PopExStk() <= operand2); break; case PCD_GE: operand2 = PopExStk(); - PushExStk(PopExStk() < operand2); + PushExStk(PopExStk() >= operand2); break; case PCD_ANDLOGICAL: operand2 = PopExStk();