wireshark/epan/dfilter
João Valverde b19bed43d1 dfilter: Allow constants as the first or only argument to min/max
The strategy here is to delay resolving literals to values until
we have looked at the entire argument list.

Also we will try to commute the relation in a comparison if
we do not have a type for the return value of the function,
like any other constant.

Before:

    Filter: max(1,_ws.ftypes.int8) == 1
    dftest: Argument '1' is not valid for max()
    	max(1,_ws.ftypes.int8) == 1
    	    ^

After:

    Filter: max(1,_ws.ftypes.int8) == 1

    Syntax tree:
     0 TEST_ANY_EQ:
       1 FUNCTION(max#2):
         2 FVALUE(1 <FT_INT8>)
         2 FIELD(_ws.ftypes.int8 <FT_INT8>)
       1 FVALUE(1 <FT_INT8>)

    Instructions:
    00000 STACK_PUSH	1 <FT_INT8>
    00001 READ_TREE		_ws.ftypes.int8 <FT_INT8> -> reg#1
    00002 IF_FALSE_GOTO	3
    00003 STACK_PUSH	reg#1
    00004 CALL_FUNCTION	max(reg#1, 1 <FT_INT8>) -> reg#0
    00005 STACK_POP	2
    00006 IF_FALSE_GOTO	8
    00007 ANY_EQ		reg#0 == 1 <FT_INT8>
    00008 RETURN
2022-12-27 02:21:06 +00:00
..
.editorconfig dfilter: Fix EditorConfig settings 2022-03-21 17:49:12 +00:00
CMakeLists.txt dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
dfilter-int.h dfilter: Allow constants as the first or only argument to min/max 2022-12-27 02:21:06 +00:00
dfilter-loc.h dfilter: Refactor error location tracking 2022-12-23 18:23:06 +00:00
dfilter-macro.c dfilter: Add suport for raw addressing with references 2022-10-31 21:02:39 +00:00
dfilter-macro.h dfilter: Refactor macro tree references 2022-03-29 12:36:31 +00:00
dfilter.c dfilter: Allow constants as the first or only argument to min/max 2022-12-27 02:21:06 +00:00
dfilter.h dfilter: Refactor error location tracking 2022-12-23 18:23:06 +00:00
dfunctions.c dfilter: Allow constants as the first or only argument to min/max 2022-12-27 02:21:06 +00:00
dfunctions.h dfilter: Refactor error location tracking 2022-12-23 18:23:06 +00:00
dfvm.c dfilter: Allow the first DFVM argument to be an fvalue 2022-12-26 12:40:23 +00:00
dfvm.h dfilter: Add suport for raw addressing with references 2022-10-31 21:02:39 +00:00
drange.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
drange.h dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
gencode.c dfilter: Fix crash with a constant arithmetic expression 2022-12-26 23:55:27 +00:00
gencode.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
grammar.lemon dfilter: Fix grammar memory leak 2022-12-26 18:48:54 +00:00
scanner.l dfilter: Change two scanner patterns to camel case 2022-12-26 07:27:40 +00:00
semcheck.c dfilter: Allow constants as the first or only argument to min/max 2022-12-27 02:21:06 +00:00
semcheck.h dfilter: Allow arithmetic expression to commute 2022-12-26 20:50:44 +00:00
sttype-field.c dfilter: Improve representation of raw field references 2022-10-31 21:02:39 +00:00
sttype-field.h dfilter: Add support for raw (bytes) addressing mode 2022-10-31 21:02:39 +00:00
sttype-function.c dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
sttype-function.h dfilter: Allow arithmetic expressions as function arguments 2022-04-18 17:10:31 +01:00
sttype-op.c dfilter: Improve error location for expressions 2022-12-23 18:23:14 +00:00
sttype-op.h dfilter: Rename test syntax tree node 2022-07-02 11:39:17 +01:00
sttype-pointer.c dfilter: Remove STTYPE_RANGE_NODE 2022-06-25 16:06:48 +01:00
sttype-pointer.h dfilter: Add max() and min() functions 2022-04-14 13:07:41 +00:00
sttype-set.c Remove some unnecessary casts. 2021-10-27 10:24:20 +01:00
sttype-set.h epan: Add header files to Doxygen 2021-11-30 08:46:49 +00:00
sttype-slice.c dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-slice.h dfilter: Add layer support for references 2022-06-25 14:57:40 +01:00
sttype-string.c dfilter: Remove unparsed syntax type and RHS literal bias 2022-07-02 11:18:20 +01:00
syntax-tree.c dfilter: Improve error location for parenthesized expressions 2022-12-26 03:20:30 +00:00
syntax-tree.h dfilter: Fix an assertion macro 2022-12-26 20:22:21 +00:00