diff options
author | João Valverde <j@v6e.pt> | 2022-12-26 01:25:25 +0000 |
---|---|---|
committer | João Valverde <j@v6e.pt> | 2022-12-26 20:50:44 +0000 |
commit | 3ddb017a88797f520cda45961819c7084a0a5b29 (patch) | |
tree | 18f5d01760b2f5a9c00a67a56fa666352b753662 /test/captures/wpa-Induction.pcap.gz | |
parent | c37552c43ce36868761076dbdbfcb679c168e52f (diff) |
dfilter: Allow arithmetic expression to commute
Allow an arithmetic expression like 1 + some.field. If we
cannot assign a type to the LHS commute the terms and
try again.
Before:
Filter: _ws.ftypes.int32 + 1 == 10
Syntax tree:
0 TEST_ANY_EQ:
1 OP_ADD:
2 FIELD(_ws.ftypes.int32 <FT_INT32>)
2 FVALUE(1 <FT_INT32>)
1 FVALUE(10 <FT_INT32>)
Instructions:
00000 READ_TREE _ws.ftypes.int32 <FT_INT32> -> reg#0
00001 IF_FALSE_GOTO 4
00002 ADD reg#0 + 1 <FT_INT32> -> reg#1
00003 ANY_EQ reg#1 == 10 <FT_INT32>
00004 RETURN
Filter: 1 + _ws.ftypes.int32 == 10
dftest: Constant arithmetic expression on the LHS is invalid.
1 + _ws.ftypes.int32 == 10
^
After:
Filter: _ws.ftypes.int32 + 1 == 10
Syntax tree:
0 TEST_ANY_EQ:
1 OP_ADD:
2 FIELD(_ws.ftypes.int32 <FT_INT32>)
2 FVALUE(1 <FT_INT32>)
1 FVALUE(10 <FT_INT32>)
Instructions:
00000 READ_TREE _ws.ftypes.int32 <FT_INT32> -> reg#0
00001 IF_FALSE_GOTO 4
00002 ADD reg#0 + 1 <FT_INT32> -> reg#1
00003 ANY_EQ reg#1 == 10 <FT_INT32>
00004 RETURN
Filter: 1 + _ws.ftypes.int32 == 10
Syntax tree:
0 TEST_ANY_EQ:
1 OP_ADD:
2 FVALUE(1 <FT_INT32>)
2 FIELD(_ws.ftypes.int32 <FT_INT32>)
1 FVALUE(10 <FT_INT32>)
Instructions:
00000 READ_TREE _ws.ftypes.int32 <FT_INT32> -> reg#0
00001 IF_FALSE_GOTO 4
00002 ADD 1 <FT_INT32> + reg#0 -> reg#1
00003 ANY_EQ reg#1 == 10 <FT_INT32>
00004 RETURN
Diffstat (limited to 'test/captures/wpa-Induction.pcap.gz')
0 files changed, 0 insertions, 0 deletions