From f7421f067155869efc71f0838194b4a6c98eb3a4 Mon Sep 17 00:00:00 2001 From: basil00 Date: Thu, 16 Mar 2023 07:04:24 +0800 Subject: [PATCH] Fix TEST simplification logic (again). "ip.DstAddr >= 0.0.0.0" ---> "ip" "ip.DstAddr < 0.0.0.0" ---> "false" Previously, the latter simplified to "not ip". --- dll/windivert_helper.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/dll/windivert_helper.c b/dll/windivert_helper.c index 15f3f0c..e9a62e7 100644 --- a/dll/windivert_helper.c +++ b/dll/windivert_helper.c @@ -1949,8 +1949,8 @@ static void WinDivertSimplifyTest(PEXPR test) default: return; } - test->arg[0] = WinDivertMakeVar(type, NULL); - test->arg[1] = (result? WinDivertMakeOne(): WinDivertMakeZero()); + test->arg[0] = WinDivertMakeVar((result? type: TOKEN_ZERO), NULL); + test->arg[1] = WinDivertMakeOne(); test->kind = TOKEN_EQ; }