[Forensics-changes] [yara] 10/368: Fix issue #325

Hilko Bengen bengen at moszumanska.debian.org
Sat Jul 1 10:30:05 UTC 2017


This is an automated email from the git hooks/post-receive script.

bengen pushed a commit to annotated tag v3.5.0
in repository yara.

commit c666ae1e1a4ecfc1eb536f6aa1b58f3305b6679c
Author: Victor M. Alvarez <plusvic at gmail.com>
Date:   Tue Jun 30 20:35:56 2015 +0200

    Fix issue #325
---
 libyara/grammar.c | 708 ++++++++++++++++++++++++++++--------------------------
 libyara/grammar.y |  15 +-
 2 files changed, 373 insertions(+), 350 deletions(-)

diff --git a/libyara/grammar.c b/libyara/grammar.c
index 07c712b..d0c07b1 100644
--- a/libyara/grammar.c
+++ b/libyara/grammar.c
@@ -502,16 +502,16 @@ union yyalloc
 /* YYFINAL -- State number of the termination state.  */
 #define YYFINAL  2
 /* YYLAST -- Last index in YYTABLE.  */
-#define YYLAST   390
+#define YYLAST   391
 
 /* YYNTOKENS -- Number of terminals.  */
 #define YYNTOKENS  71
 /* YYNNTS -- Number of nonterminals.  */
-#define YYNNTS  38
+#define YYNNTS  39
 /* YYNRULES -- Number of rules.  */
-#define YYNRULES  115
+#define YYNRULES  116
 /* YYNRULES -- Number of states.  */
-#define YYNSTATES  200
+#define YYNSTATES  201
 
 /* YYTRANSLATE(YYLEX) -- Bison symbol number corresponding to YYLEX.  */
 #define YYUNDEFTOK  2
@@ -565,14 +565,14 @@ static const yytype_uint16 yyprhs[] =
       26,    37,    38,    42,    43,    47,    51,    52,    55,    57,
       59,    60,    63,    65,    68,    70,    73,    77,    81,    85,
       89,    91,    94,    99,   100,   106,   110,   111,   114,   116,
-     118,   120,   122,   124,   128,   133,   138,   139,   141,   145,
-     147,   149,   151,   153,   157,   161,   163,   167,   171,   172,
-     173,   185,   186,   196,   200,   203,   204,   209,   210,   215,
-     219,   223,   227,   231,   235,   239,   241,   245,   249,   251,
-     257,   259,   263,   264,   269,   271,   273,   277,   279,   281,
-     283,   285,   287,   291,   293,   295,   300,   302,   304,   306,
-     308,   313,   315,   317,   320,   324,   328,   332,   336,   340,
-     344,   348,   352,   355,   359,   363
+     118,   120,   122,   124,   128,   133,   138,   139,   141,   143,
+     147,   149,   151,   153,   155,   159,   163,   165,   169,   173,
+     174,   175,   187,   188,   198,   202,   205,   206,   211,   212,
+     217,   221,   225,   229,   233,   237,   241,   243,   247,   251,
+     253,   259,   261,   265,   266,   271,   273,   275,   279,   281,
+     283,   285,   287,   289,   293,   295,   297,   302,   304,   306,
+     308,   310,   315,   317,   319,   322,   326,   330,   334,   338,
+     342,   346,   350,   354,   357,   361,   365
 };
 
 /* YYRHS -- A `-1'-separated list of the rules' RHS.  */
@@ -582,7 +582,7 @@ static const yytype_int8 yyrhs[] =
       72,     1,    74,    -1,    72,     1,    73,    -1,    72,     1,
       60,    -1,    36,    18,    -1,    -1,    79,     4,    10,    81,
       61,    76,    77,    75,    78,    62,    -1,    -1,     7,    63,
-      83,    -1,    -1,     8,    63,    85,    -1,     9,    63,    93,
+      83,    -1,    -1,     8,    63,    85,    -1,     9,    63,    94,
       -1,    -1,    79,    80,    -1,     5,    -1,     6,    -1,    -1,
       63,    82,    -1,    10,    -1,    82,    10,    -1,    84,    -1,
       83,    84,    -1,    10,    64,    18,    -1,    10,    64,    15,
@@ -591,30 +591,30 @@ static const yytype_int8 yyrhs[] =
       11,    64,    87,    20,    88,    -1,    11,    64,    19,    -1,
       -1,    88,    89,    -1,    22,    -1,    21,    -1,    23,    -1,
       24,    -1,    10,    -1,    90,    65,    10,    -1,    90,    66,
-     108,    67,    -1,    90,    68,    91,    69,    -1,    -1,    94,
-      -1,    91,    70,    94,    -1,    20,    -1,    94,    -1,    37,
-      -1,    38,    -1,   108,    34,    92,    -1,   108,    35,   108,
-      -1,    11,    -1,    11,    25,   108,    -1,    11,    30,   101,
-      -1,    -1,    -1,    32,   107,    10,    30,    95,   100,    63,
-      96,    68,    93,    69,    -1,    -1,    32,   107,    31,   103,
-      63,    97,    68,    93,    69,    -1,   107,    31,   103,    -1,
-      59,    93,    -1,    -1,    93,    40,    98,    93,    -1,    -1,
-      93,    39,    99,    93,    -1,   108,    49,   108,    -1,   108,
-      47,   108,    -1,   108,    48,   108,    -1,   108,    46,   108,
-      -1,   108,    45,   108,    -1,   108,    44,   108,    -1,   108,
-      -1,    68,    94,    69,    -1,    68,   102,    69,    -1,   101,
-      -1,    68,   108,     3,   108,    69,    -1,   108,    -1,   102,
-      70,   108,    -1,    -1,    68,   104,   105,    69,    -1,    33,
-      -1,   106,    -1,   105,    70,   106,    -1,    11,    -1,    14,
-      -1,   108,    -1,    28,    -1,    29,    -1,    68,   108,    69,
-      -1,    26,    -1,    27,    -1,    17,    68,   108,    69,    -1,
-      15,    -1,    16,    -1,    18,    -1,    12,    -1,    13,    66,
-     108,    67,    -1,    13,    -1,    90,    -1,    53,   108,    -1,
-     108,    52,   108,    -1,   108,    53,   108,    -1,   108,    54,
-     108,    -1,   108,    55,   108,    -1,   108,    56,   108,    -1,
-     108,    42,   108,    -1,   108,    43,   108,    -1,   108,    41,
-     108,    -1,    57,   108,    -1,   108,    51,   108,    -1,   108,
-      50,   108,    -1,    92,    -1
+     109,    67,    -1,    90,    68,    91,    69,    -1,    -1,    92,
+      -1,    95,    -1,    92,    70,    95,    -1,    20,    -1,    95,
+      -1,    37,    -1,    38,    -1,   109,    34,    93,    -1,   109,
+      35,   109,    -1,    11,    -1,    11,    25,   109,    -1,    11,
+      30,   102,    -1,    -1,    -1,    32,   108,    10,    30,    96,
+     101,    63,    97,    68,    94,    69,    -1,    -1,    32,   108,
+      31,   104,    63,    98,    68,    94,    69,    -1,   108,    31,
+     104,    -1,    59,    94,    -1,    -1,    94,    40,    99,    94,
+      -1,    -1,    94,    39,   100,    94,    -1,   109,    49,   109,
+      -1,   109,    47,   109,    -1,   109,    48,   109,    -1,   109,
+      46,   109,    -1,   109,    45,   109,    -1,   109,    44,   109,
+      -1,   109,    -1,    68,    95,    69,    -1,    68,   103,    69,
+      -1,   102,    -1,    68,   109,     3,   109,    69,    -1,   109,
+      -1,   103,    70,   109,    -1,    -1,    68,   105,   106,    69,
+      -1,    33,    -1,   107,    -1,   106,    70,   107,    -1,    11,
+      -1,    14,    -1,   109,    -1,    28,    -1,    29,    -1,    68,
+     109,    69,    -1,    26,    -1,    27,    -1,    17,    68,   109,
+      69,    -1,    15,    -1,    16,    -1,    18,    -1,    12,    -1,
+      13,    66,   109,    67,    -1,    13,    -1,    90,    -1,    53,
+     109,    -1,   109,    52,   109,    -1,   109,    53,   109,    -1,
+     109,    54,   109,    -1,   109,    55,   109,    -1,   109,    56,
+     109,    -1,   109,    42,   109,    -1,   109,    43,   109,    -1,
+     109,    41,   109,    -1,    57,   109,    -1,   109,    51,   109,
+      -1,   109,    50,   109,    -1,    93,    -1
 };
 
 /* YYRLINE[YYN] -- source line where rule number YYN was defined.  */
@@ -624,14 +624,14 @@ static const yytype_uint16 yyrline[] =
      218,   248,   251,   279,   282,   309,   314,   315,   320,   321,
      327,   330,   348,   361,   398,   399,   404,   420,   433,   446,
      463,   464,   469,   483,   482,   501,   518,   519,   524,   525,
-     526,   527,   532,   623,   672,   732,   780,   783,   808,   844,
-     890,   907,   916,   925,   940,   954,   968,   984,   999,  1035,
-     998,  1151,  1150,  1230,  1236,  1243,  1242,  1303,  1302,  1361,
-    1370,  1379,  1388,  1397,  1406,  1415,  1419,  1427,  1428,  1433,
-    1455,  1467,  1483,  1482,  1488,  1497,  1498,  1503,  1508,  1517,
-    1518,  1522,  1530,  1534,  1544,  1558,  1574,  1584,  1593,  1617,
-    1632,  1647,  1670,  1714,  1733,  1751,  1769,  1787,  1805,  1815,
-    1825,  1835,  1845,  1855,  1865,  1875
+     526,   527,   532,   623,   672,   732,   779,   780,   784,   809,
+     845,   891,   908,   917,   926,   941,   955,   969,   985,  1000,
+    1036,   999,  1152,  1151,  1231,  1237,  1244,  1243,  1304,  1303,
+    1362,  1371,  1380,  1389,  1398,  1407,  1416,  1420,  1428,  1429,
+    1434,  1456,  1468,  1484,  1483,  1489,  1498,  1499,  1504,  1509,
+    1518,  1519,  1523,  1531,  1535,  1545,  1559,  1575,  1585,  1594,
+    1618,  1633,  1648,  1671,  1715,  1734,  1752,  1770,  1788,  1814,
+    1832,  1842,  1852,  1862,  1872,  1882,  1892
 };
 #endif
 
@@ -655,11 +655,11 @@ static const char *const yytname[] =
   "import", "rule", "@1", "meta", "strings", "condition", "rule_modifiers",
   "rule_modifier", "tags", "tag_list", "meta_declarations",
   "meta_declaration", "string_declarations", "string_declaration", "@2",
-  "string_modifiers", "string_modifier", "identifier", "arguments_list",
-  "regexp", "boolean_expression", "expression", "@3", "@4", "@5", "@6",
-  "@7", "integer_set", "range", "integer_enumeration", "string_set", "@8",
-  "string_enumeration", "string_enumeration_item", "for_expression",
-  "primary_expression", 0
+  "string_modifiers", "string_modifier", "identifier", "arguments",
+  "arguments_list", "regexp", "boolean_expression", "expression", "@3",
+  "@4", "@5", "@6", "@7", "integer_set", "range", "integer_enumeration",
+  "string_set", "@8", "string_enumeration", "string_enumeration_item",
+  "for_expression", "primary_expression", 0
 };
 #endif
 
@@ -686,14 +686,14 @@ static const yytype_uint8 yyr1[] =
       74,    76,    76,    77,    77,    78,    79,    79,    80,    80,
       81,    81,    82,    82,    83,    83,    84,    84,    84,    84,
       85,    85,    86,    87,    86,    86,    88,    88,    89,    89,
-      89,    89,    90,    90,    90,    90,    91,    91,    91,    92,
-      93,    94,    94,    94,    94,    94,    94,    94,    95,    96,
-      94,    97,    94,    94,    94,    98,    94,    99,    94,    94,
-      94,    94,    94,    94,    94,    94,    94,   100,   100,   101,
-     102,   102,   104,   103,   103,   105,   105,   106,   106,   107,
-     107,   107,   108,   108,   108,   108,   108,   108,   108,   108,
-     108,   108,   108,   108,   108,   108,   108,   108,   108,   108,
-     108,   108,   108,   108,   108,   108
+      89,    89,    90,    90,    90,    90,    91,    91,    92,    92,
+      93,    94,    95,    95,    95,    95,    95,    95,    95,    96,
+      97,    95,    98,    95,    95,    95,    99,    95,   100,    95,
+      95,    95,    95,    95,    95,    95,    95,    95,   101,   101,
+     102,   103,   103,   105,   104,   104,   106,   106,   107,   107,
+     108,   108,   108,   109,   109,   109,   109,   109,   109,   109,
+     109,   109,   109,   109,   109,   109,   109,   109,   109,   109,
+     109,   109,   109,   109,   109,   109,   109
 };
 
 /* YYR2[YYN] -- Number of symbols composing right hand side of rule YYN.  */
@@ -703,14 +703,14 @@ static const yytype_uint8 yyr2[] =
       10,     0,     3,     0,     3,     3,     0,     2,     1,     1,
        0,     2,     1,     2,     1,     2,     3,     3,     3,     3,
        1,     2,     4,     0,     5,     3,     0,     2,     1,     1,
-       1,     1,     1,     3,     4,     4,     0,     1,     3,     1,
-       1,     1,     1,     3,     3,     1,     3,     3,     0,     0,
-      11,     0,     9,     3,     2,     0,     4,     0,     4,     3,
-       3,     3,     3,     3,     3,     1,     3,     3,     1,     5,
-       1,     3,     0,     4,     1,     1,     3,     1,     1,     1,
-       1,     1,     3,     1,     1,     4,     1,     1,     1,     1,
-       4,     1,     1,     2,     3,     3,     3,     3,     3,     3,
-       3,     3,     2,     3,     3,     1
+       1,     1,     1,     3,     4,     4,     0,     1,     1,     3,
+       1,     1,     1,     1,     3,     3,     1,     3,     3,     0,
+       0,    11,     0,     9,     3,     2,     0,     4,     0,     4,
+       3,     3,     3,     3,     3,     3,     1,     3,     3,     1,
+       5,     1,     3,     0,     4,     1,     1,     3,     1,     1,
+       1,     1,     1,     3,     1,     1,     4,     1,     1,     1,
+       1,     4,     1,     1,     2,     3,     3,     3,     3,     3,
+       3,     3,     3,     2,     3,     3,     1
 };
 
 /* YYDEFACT[STATE-NAME] -- Default rule to reduce with in state
@@ -723,21 +723,22 @@ static const yytype_uint8 yydefact[] =
       21,    11,    23,     0,    13,     0,     0,     9,     0,    12,
       24,     0,     0,     0,    25,     0,    14,    30,     0,     0,
       27,    26,    28,    29,    33,    31,     0,    10,    36,    35,
-       0,    42,    55,    99,   101,    96,    97,     0,    98,    49,
-      93,    94,    90,    91,     0,    51,    52,     0,     0,     0,
-       0,   102,   115,    15,    50,     0,    75,    32,    36,     0,
-       0,     0,     0,     0,     0,    89,   103,   112,    64,     0,
-      50,    75,     0,     0,    46,    67,    65,     0,     0,     0,
+       0,    42,    56,   100,   102,    97,    98,     0,    99,    50,
+      94,    95,    91,    92,     0,    52,    53,     0,     0,     0,
+       0,   103,   116,    15,    51,     0,    76,    32,    36,     0,
+       0,     0,     0,     0,     0,    90,   104,   113,    65,     0,
+      51,    76,     0,     0,    46,    68,    66,     0,     0,     0,
        0,     0,     0,     0,     0,     0,     0,     0,     0,     0,
        0,     0,     0,     0,     0,     0,    39,    38,    40,    41,
-      37,    34,    56,     0,    57,     0,     0,     0,     0,     0,
-      76,    92,    43,     0,     0,    47,     0,     0,    84,    82,
-      63,    53,    54,   111,   109,   110,    74,    73,    72,    70,
-      71,    69,   114,   113,   104,   105,   106,   107,   108,     0,
-     100,    95,    58,     0,    44,    45,     0,    68,    66,     0,
-       0,     0,    61,    48,    87,    88,     0,    85,     0,     0,
-       0,    78,     0,    83,     0,    79,     0,    80,    59,     0,
-      86,    77,     0,     0,     0,    81,     0,    62,     0,    60
+      37,    34,    57,     0,    58,     0,     0,     0,     0,     0,
+      77,    93,    43,     0,     0,    47,    48,     0,     0,    85,
+      83,    64,    54,    55,   112,   110,   111,    75,    74,    73,
+      71,    72,    70,   115,   114,   105,   106,   107,   108,   109,
+       0,   101,    96,    59,     0,    44,    45,     0,    69,    67,
+       0,     0,     0,    62,    49,    88,    89,     0,    86,     0,
+       0,     0,    79,     0,    84,     0,    80,     0,    81,    60,
+       0,    87,    78,     0,     0,     0,    82,     0,    63,     0,
+      61
 };
 
 /* YYDEFGOTO[NTERM-NUM].  */
@@ -745,8 +746,8 @@ static const yytype_int16 yydefgoto[] =
 {
       -1,     1,     5,     6,    32,    24,    27,    39,     7,    15,
       18,    20,    29,    30,    36,    37,    50,    77,   120,    71,
-     134,    72,    89,    74,   171,   193,   182,   137,   136,   180,
-     124,   186,   140,   169,   176,   177,    75,    76
+     134,   135,    72,    89,    74,   172,   194,   183,   138,   137,
+     181,   124,   187,   141,   170,   177,   178,    75,    76
 };
 
 /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
@@ -754,128 +755,129 @@ static const yytype_int16 yydefgoto[] =
 #define YYPACT_NINF -69
 static const yytype_int16 yypact[] =
 {
-     -69,    76,   -69,   -33,    -3,   -69,   -69,    29,   -69,   -69,
-     -69,   -69,     7,   -69,   -69,   -69,   -10,    45,     8,   -69,
-      69,    97,   -69,    43,   100,   103,    56,   -69,    60,   103,
-     -69,   115,   119,    -9,   -69,    66,   115,   -69,    77,    86,
-     -69,   -69,   -69,   -69,     3,   -69,    46,   -69,   -69,   -69,
-     133,   -69,   -17,   -69,    88,   -69,   -69,    89,   -69,   -69,
-     -69,   -69,   -69,   -69,   105,   -69,   -69,   129,   129,    46,
-      46,   -54,   -69,    57,   -69,   128,   282,    71,   -69,   129,
-      92,   129,   129,   129,     0,   298,   -69,   -69,   -69,    57,
-      94,   157,   151,   129,    46,   -69,   -69,    -1,   144,   129,
-     129,   129,   129,   129,   129,   129,   129,   129,   129,   129,
-     129,   129,   129,   129,   129,   129,   -69,   -69,   -69,   -69,
-     -69,    71,   298,   129,   -69,   237,   177,   197,   138,    -1,
-     -69,   -69,   -69,   255,    32,    96,    46,    46,   -69,   -69,
-     -69,   -69,   298,   313,   327,   334,   298,   298,   298,   298,
-     298,   298,    33,    33,    55,    55,   -69,   -69,   -69,   124,
-     -69,   -69,   -69,   106,   -69,   -69,    46,   130,   -69,    54,
-     129,   104,   -69,    96,   -69,   -69,    68,   -69,   217,   129,
-     108,   -69,   113,   -69,    54,   -69,    82,   124,   -69,    46,
-     -69,   -69,   129,   116,   -15,   298,    46,   -69,    31,   -69
+     -69,   190,   -69,   -33,   -10,   -69,   -69,    96,   -69,   -69,
+     -69,   -69,     0,   -69,   -69,   -69,   -41,    23,   -26,   -69,
+      45,    46,   -69,    -4,    49,    51,     8,   -69,     2,    51,
+     -69,    99,   116,    -6,   -69,    63,    99,   -69,    66,    53,
+     -69,   -69,   -69,   -69,    76,   -69,    52,   -69,   -69,   -69,
+     111,   -69,   -19,   -69,    70,   -69,   -69,    69,   -69,   -69,
+     -69,   -69,   -69,   -69,   106,   -69,   -69,   130,   130,    52,
+      52,   -51,   -69,    43,   -69,   107,   283,    64,   -69,   130,
+      71,   130,   130,   130,     3,   299,   -69,   -69,   -69,    43,
+      72,   158,   139,   130,    52,   -69,   -69,   -12,   132,   130,
+     130,   130,   130,   130,   130,   130,   130,   130,   130,   130,
+     130,   130,   130,   130,   130,   130,   -69,   -69,   -69,   -69,
+     -69,    64,   299,   130,   -69,   238,   178,   198,   123,   -12,
+     -69,   -69,   -69,   256,    85,    88,    67,    52,    52,   -69,
+     -69,   -69,   -69,   299,   314,   328,   335,   299,   299,   299,
+     299,   299,   299,    21,    21,    58,    58,   -69,   -69,   -69,
+     125,   -69,   -69,   -69,    92,   -69,   -69,    52,   120,   -69,
+      82,   130,    93,   -69,    67,   -69,   -69,    28,   -69,   218,
+     130,   101,   -69,    94,   -69,    82,   -69,    34,   125,   -69,
+      52,   -69,   -69,   130,    97,   -15,   299,    52,   -69,   -11,
+     -69
 };
 
 /* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
-     -69,   -69,   180,   182,   -69,   -69,   -69,   -69,   -69,   -69,
-     -69,   -69,   -69,   158,   -69,   153,   -69,   112,   -69,   -69,
-     -69,    95,   -46,   -68,   -69,   -69,   -69,   -69,   -69,   -69,
-      23,   -69,    67,   -69,   -69,    11,   150,   -63
+     -69,   -69,   166,   167,   -69,   -69,   -69,   -69,   -69,   -69,
+     -69,   -69,   -69,   142,   -69,   136,   -69,    95,   -69,   -69,
+     -69,   -69,    84,   -46,   -68,   -69,   -69,   -69,   -69,   -69,
+     -69,    12,   -69,    56,   -69,   -69,     1,   124,   -63
 };
 
 /* YYTABLE[YYPACT[STATE-NUM]].  What to do in state STATE-NUM.  If
    positive, shift that token.  If negative, reduce the rule which
    number is the opposite.  If zero, do what YYDEFACT says.
    If YYTABLE_NINF, syntax error.  */
-#define YYTABLE_NINF -90
+#define YYTABLE_NINF -91
 static const yytype_int16 yytable[] =
 {
-      73,    85,    90,     4,    86,    87,    40,    91,    79,    41,
-     128,    92,    93,    80,    94,    11,   122,    16,   125,   126,
-     127,    48,    49,    88,    95,    96,   135,     8,    42,    43,
-     133,   129,   138,    12,    13,    14,   142,   143,   144,   145,
-     146,   147,   148,   149,   150,   151,   152,   153,   154,   155,
-     156,   157,   158,    17,   197,    19,    51,    52,    53,    54,
-     159,    55,    56,    57,    58,   174,    59,   139,   175,    21,
-      95,    96,    60,    61,    62,    63,     2,     3,    64,    22,
-     -16,   -16,   -16,    65,    66,   111,   112,   113,   114,   115,
-     167,   168,   116,   117,   118,   119,    95,    96,   173,    67,
-     199,   165,   166,    68,    23,    69,    25,   178,    26,   113,
-     114,   115,     4,    28,    70,    51,   187,    53,    54,    31,
-      55,    56,    57,    58,    33,    59,    35,   170,    38,   195,
-      44,    60,    61,    62,    63,   -50,   -50,   183,   184,    51,
-      46,    53,    54,   194,    55,    56,    57,    58,    47,    59,
-     198,   191,   192,    78,    81,    60,    61,    82,    67,    97,
-     123,   132,    68,   130,    59,   100,   101,   102,   162,   172,
-      96,   188,   179,    83,   109,   110,   111,   112,   113,   114,
-     115,   189,    67,     9,   196,    10,    68,    34,   -89,    45,
-     121,    98,    99,   141,   181,   190,   163,    83,   100,   101,
-     102,   103,   104,   105,   106,   107,   108,   109,   110,   111,
-     112,   113,   114,   115,    84,     0,     0,     0,   100,   101,
-     102,     0,     0,     0,     0,     0,   131,   109,   110,   111,
-     112,   113,   114,   115,     0,     0,     0,     0,   100,   101,
-     102,     0,     0,     0,     0,     0,   161,   109,   110,   111,
-     112,   113,   114,   115,     0,     0,     0,     0,   100,   101,
-     102,     0,     0,     0,     0,     0,   131,   109,   110,   111,
-     112,   113,   114,   115,     0,     0,     0,     0,   100,   101,
-     102,     0,     0,     0,     0,     0,   185,   109,   110,   111,
-     112,   113,   114,   115,     0,     0,   100,   101,   102,     0,
-       0,     0,     0,     0,   160,   109,   110,   111,   112,   113,
-     114,   115,     0,   -89,     0,     0,    98,    99,     0,     0,
-       0,     0,   164,   100,   101,   102,   103,   104,   105,   106,
-     107,   108,   109,   110,   111,   112,   113,   114,   115,   100,
-     101,   102,     0,     0,     0,     0,     0,     0,   109,   110,
-     111,   112,   113,   114,   115,   101,   102,     0,     0,     0,
-       0,     0,     0,   109,   110,   111,   112,   113,   114,   115,
-     102,     0,     0,     0,     0,     0,     0,   109,   110,   111,
-     112,   113,   114,   115,   109,   110,   111,   112,   113,   114,
-     115
+      73,    85,    90,     4,    86,    87,    79,    91,    11,    40,
+      16,    80,    41,   128,    92,    93,   122,    94,   125,   126,
+     127,   139,    17,    88,    95,    96,   136,     8,    95,    96,
+     133,    42,    43,    19,   129,    21,   143,   144,   145,   146,
+     147,   148,   149,   150,   151,   152,   153,   154,   155,   156,
+     157,   158,   159,    23,   198,    22,   140,    26,   200,    25,
+     160,    28,    51,    52,    53,    54,    33,    55,    56,    57,
+      58,    31,    59,   111,   112,   113,   114,   115,    60,    61,
+      62,    63,    95,    96,    64,   116,   117,   118,   119,    65,
+      66,   168,   169,   175,    48,    49,   176,   184,   185,   174,
+      12,    13,    14,   192,   193,    67,   -51,   -51,   179,    68,
+      35,    69,   113,   114,   115,    47,    51,   188,    53,    54,
+      70,    55,    56,    57,    58,    38,    59,    44,   171,    46,
+     196,    78,    60,    61,    62,    63,    81,    82,    97,   123,
+      51,   130,    53,    54,   195,    55,    56,    57,    58,   132,
+      59,   199,    59,   163,   166,   173,    60,    61,   167,    67,
+      96,   180,   190,    68,   189,   197,   100,   101,   102,     9,
+      10,    34,    45,   121,    83,   109,   110,   111,   112,   113,
+     114,   115,   142,    67,   182,   164,   191,    68,    84,   -90,
+       2,     3,    98,    99,   -16,   -16,   -16,     0,    83,   100,
+     101,   102,   103,   104,   105,   106,   107,   108,   109,   110,
+     111,   112,   113,   114,   115,     0,     0,     0,     0,   100,
+     101,   102,     0,     0,     0,     0,     4,   131,   109,   110,
+     111,   112,   113,   114,   115,     0,     0,     0,     0,   100,
+     101,   102,     0,     0,     0,     0,     0,   162,   109,   110,
+     111,   112,   113,   114,   115,     0,     0,     0,     0,   100,
+     101,   102,     0,     0,     0,     0,     0,   131,   109,   110,
+     111,   112,   113,   114,   115,     0,     0,     0,     0,   100,
+     101,   102,     0,     0,     0,     0,     0,   186,   109,   110,
+     111,   112,   113,   114,   115,     0,     0,   100,   101,   102,
+       0,     0,     0,     0,     0,   161,   109,   110,   111,   112,
+     113,   114,   115,     0,   -90,     0,     0,    98,    99,     0,
+       0,     0,     0,   165,   100,   101,   102,   103,   104,   105,
+     106,   107,   108,   109,   110,   111,   112,   113,   114,   115,
+     100,   101,   102,     0,     0,     0,     0,     0,     0,   109,
+     110,   111,   112,   113,   114,   115,   101,   102,     0,     0,
+       0,     0,     0,     0,   109,   110,   111,   112,   113,   114,
+     115,   102,     0,     0,     0,     0,     0,     0,   109,   110,
+     111,   112,   113,   114,   115,   109,   110,   111,   112,   113,
+     114,   115
 };
 
 static const yytype_int16 yycheck[] =
 {
-      46,    64,    70,    36,    67,    68,    15,    70,    25,    18,
-      10,    65,    66,    30,    68,    18,    79,    10,    81,    82,
-      83,    18,    19,    69,    39,    40,    94,    60,    37,    38,
-      93,    31,    33,     4,     5,     6,    99,   100,   101,   102,
+      46,    64,    70,    36,    67,    68,    25,    70,    18,    15,
+      10,    30,    18,    10,    65,    66,    79,    68,    81,    82,
+      83,    33,    63,    69,    39,    40,    94,    60,    39,    40,
+      93,    37,    38,    10,    31,    61,    99,   100,   101,   102,
      103,   104,   105,   106,   107,   108,   109,   110,   111,   112,
-     113,   114,   115,    63,    69,    10,    10,    11,    12,    13,
-     123,    15,    16,    17,    18,    11,    20,    68,    14,    61,
-      39,    40,    26,    27,    28,    29,     0,     1,    32,    10,
-       4,     5,     6,    37,    38,    52,    53,    54,    55,    56,
-     136,   137,    21,    22,    23,    24,    39,    40,   166,    53,
-      69,    69,    70,    57,     7,    59,    63,   170,     8,    54,
-      55,    56,    36,    10,    68,    10,   179,    12,    13,    63,
-      15,    16,    17,    18,    64,    20,    11,     3,     9,   192,
-      64,    26,    27,    28,    29,    39,    40,    69,    70,    10,
-      63,    12,    13,   189,    15,    16,    17,    18,    62,    20,
-     196,    69,    70,    20,    66,    26,    27,    68,    53,    31,
-      68,    10,    57,    69,    20,    41,    42,    43,    30,    63,
-      40,    63,    68,    68,    50,    51,    52,    53,    54,    55,
-      56,    68,    53,     3,    68,     3,    57,    29,    31,    36,
-      78,    34,    35,    98,   171,   184,   129,    68,    41,    42,
-      43,    44,    45,    46,    47,    48,    49,    50,    51,    52,
-      53,    54,    55,    56,    64,    -1,    -1,    -1,    41,    42,
-      43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,    52,
-      53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,    42,
-      43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,    52,
-      53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,    42,
-      43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,    52,
-      53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,    42,
-      43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,    52,
-      53,    54,    55,    56,    -1,    -1,    41,    42,    43,    -1,
-      -1,    -1,    -1,    -1,    67,    50,    51,    52,    53,    54,
-      55,    56,    -1,    31,    -1,    -1,    34,    35,    -1,    -1,
-      -1,    -1,    67,    41,    42,    43,    44,    45,    46,    47,
-      48,    49,    50,    51,    52,    53,    54,    55,    56,    41,
-      42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    50,    51,
-      52,    53,    54,    55,    56,    42,    43,    -1,    -1,    -1,
-      -1,    -1,    -1,    50,    51,    52,    53,    54,    55,    56,
-      43,    -1,    -1,    -1,    -1,    -1,    -1,    50,    51,    52,
-      53,    54,    55,    56,    50,    51,    52,    53,    54,    55,
-      56
+     113,   114,   115,     7,    69,    10,    68,     8,    69,    63,
+     123,    10,    10,    11,    12,    13,    64,    15,    16,    17,
+      18,    63,    20,    52,    53,    54,    55,    56,    26,    27,
+      28,    29,    39,    40,    32,    21,    22,    23,    24,    37,
+      38,   137,   138,    11,    18,    19,    14,    69,    70,   167,
+       4,     5,     6,    69,    70,    53,    39,    40,   171,    57,
+      11,    59,    54,    55,    56,    62,    10,   180,    12,    13,
+      68,    15,    16,    17,    18,     9,    20,    64,     3,    63,
+     193,    20,    26,    27,    28,    29,    66,    68,    31,    68,
+      10,    69,    12,    13,   190,    15,    16,    17,    18,    10,
+      20,   197,    20,    30,    69,    63,    26,    27,    70,    53,
+      40,    68,    68,    57,    63,    68,    41,    42,    43,     3,
+       3,    29,    36,    78,    68,    50,    51,    52,    53,    54,
+      55,    56,    98,    53,   172,   129,   185,    57,    64,    31,
+       0,     1,    34,    35,     4,     5,     6,    -1,    68,    41,
+      42,    43,    44,    45,    46,    47,    48,    49,    50,    51,
+      52,    53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,
+      42,    43,    -1,    -1,    -1,    -1,    36,    69,    50,    51,
+      52,    53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,
+      42,    43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,
+      52,    53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,
+      42,    43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,
+      52,    53,    54,    55,    56,    -1,    -1,    -1,    -1,    41,
+      42,    43,    -1,    -1,    -1,    -1,    -1,    69,    50,    51,
+      52,    53,    54,    55,    56,    -1,    -1,    41,    42,    43,
+      -1,    -1,    -1,    -1,    -1,    67,    50,    51,    52,    53,
+      54,    55,    56,    -1,    31,    -1,    -1,    34,    35,    -1,
+      -1,    -1,    -1,    67,    41,    42,    43,    44,    45,    46,
+      47,    48,    49,    50,    51,    52,    53,    54,    55,    56,
+      41,    42,    43,    -1,    -1,    -1,    -1,    -1,    -1,    50,
+      51,    52,    53,    54,    55,    56,    42,    43,    -1,    -1,
+      -1,    -1,    -1,    -1,    50,    51,    52,    53,    54,    55,
+      56,    43,    -1,    -1,    -1,    -1,    -1,    -1,    50,    51,
+      52,    53,    54,    55,    56,    50,    51,    52,    53,    54,
+      55,    56
 };
 
 /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
@@ -889,19 +891,20 @@ static const yytype_uint8 yystos[] =
       15,    18,    37,    38,    64,    86,    63,    62,    18,    19,
       87,    10,    11,    12,    13,    15,    16,    17,    18,    20,
       26,    27,    28,    29,    32,    37,    38,    53,    57,    59,
-      68,    90,    92,    93,    94,   107,   108,    88,    20,    25,
-      30,    66,    68,    68,   107,   108,   108,   108,    93,    93,
-      94,   108,    65,    66,    68,    39,    40,    31,    34,    35,
+      68,    90,    93,    94,    95,   108,   109,    88,    20,    25,
+      30,    66,    68,    68,   108,   109,   109,   109,    94,    94,
+      95,   109,    65,    66,    68,    39,    40,    31,    34,    35,
       41,    42,    43,    44,    45,    46,    47,    48,    49,    50,
       51,    52,    53,    54,    55,    56,    21,    22,    23,    24,
-      89,    88,   108,    68,   101,   108,   108,   108,    10,    31,
-      69,    69,    10,   108,    91,    94,    99,    98,    33,    68,
-     103,    92,   108,   108,   108,   108,   108,   108,   108,   108,
-     108,   108,   108,   108,   108,   108,   108,   108,   108,   108,
-      67,    69,    30,   103,    67,    69,    70,    93,    93,   104,
-       3,    95,    63,    94,    11,    14,   105,   106,   108,    68,
-     100,   101,    97,    69,    70,    69,   102,   108,    63,    68,
-     106,    69,    70,    96,    93,   108,    68,    69,    93,    69
+      89,    88,   109,    68,   102,   109,   109,   109,    10,    31,
+      69,    69,    10,   109,    91,    92,    95,   100,    99,    33,
+      68,   104,    93,   109,   109,   109,   109,   109,   109,   109,
+     109,   109,   109,   109,   109,   109,   109,   109,   109,   109,
+     109,    67,    69,    30,   104,    67,    69,    70,    94,    94,
+     105,     3,    96,    63,    95,    11,    14,   106,   107,   109,
+      68,   101,   102,    98,    69,    70,    69,   103,   109,    63,
+      68,   107,    69,    70,    97,    94,   109,    68,    69,    94,
+      69
 };
 
 #define yyerrok		(yyerrstatus = 0)
@@ -1424,42 +1427,42 @@ yydestruct (yymsg, yytype, yyvaluep, yyscanner, compiler)
       case 10: /* "_IDENTIFIER_" */
 #line 172 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1428 "grammar.c"
+#line 1431 "grammar.c"
 	break;
       case 11: /* "_STRING_IDENTIFIER_" */
 #line 173 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1433 "grammar.c"
+#line 1436 "grammar.c"
 	break;
       case 12: /* "_STRING_COUNT_" */
 #line 174 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1438 "grammar.c"
+#line 1441 "grammar.c"
 	break;
       case 13: /* "_STRING_OFFSET_" */
 #line 175 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1443 "grammar.c"
+#line 1446 "grammar.c"
 	break;
       case 14: /* "_STRING_IDENTIFIER_WITH_WILDCARD_" */
 #line 176 "grammar.y"
 	{ yr_free((yyvaluep->c_string)); };
-#line 1448 "grammar.c"
+#line 1451 "grammar.c"
 	break;
       case 18: /* "_TEXT_STRING_" */
 #line 177 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1453 "grammar.c"
+#line 1456 "grammar.c"
 	break;
       case 19: /* "_HEX_STRING_" */
 #line 178 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1458 "grammar.c"
+#line 1461 "grammar.c"
 	break;
       case 20: /* "_REGEXP_" */
 #line 179 "grammar.y"
 	{ yr_free((yyvaluep->sized_string)); };
-#line 1463 "grammar.c"
+#line 1466 "grammar.c"
 	break;
 
       default:
@@ -2400,14 +2403,17 @@ yyreduce:
     break;
 
   case 46:
-#line 780 "grammar.y"
-    {
-        (yyval.c_string) = yr_strdup("");
-      }
+#line 779 "grammar.y"
+    { (yyval.c_string) = yr_strdup(""); }
     break;
 
   case 47:
-#line 784 "grammar.y"
+#line 780 "grammar.y"
+    { (yyval.c_string) = (yyvsp[(1) - (1)].c_string); }
+    break;
+
+  case 48:
+#line 785 "grammar.y"
     {
         (yyval.c_string) = (char*) yr_malloc(MAX_FUNCTION_ARGS + 1);
 
@@ -2434,8 +2440,8 @@ yyreduce:
       }
     break;
 
-  case 48:
-#line 809 "grammar.y"
+  case 49:
+#line 810 "grammar.y"
     {
         if (strlen((yyvsp[(1) - (3)].c_string)) == MAX_FUNCTION_ARGS)
         {
@@ -2469,8 +2475,8 @@ yyreduce:
       }
     break;
 
-  case 49:
-#line 845 "grammar.y"
+  case 50:
+#line 846 "grammar.y"
     {
         SIZED_STRING* sized_string = (yyvsp[(1) - (1)].sized_string);
         RE* re;
@@ -2514,8 +2520,8 @@ yyreduce:
       }
     break;
 
-  case 50:
-#line 891 "grammar.y"
+  case 51:
+#line 892 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type == EXPRESSION_TYPE_STRING)
         {
@@ -2531,8 +2537,8 @@ yyreduce:
       }
     break;
 
-  case 51:
-#line 908 "grammar.y"
+  case 52:
+#line 909 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 1, NULL, NULL);
@@ -2543,8 +2549,8 @@ yyreduce:
       }
     break;
 
-  case 52:
-#line 917 "grammar.y"
+  case 53:
+#line 918 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, 0, NULL, NULL);
@@ -2555,8 +2561,8 @@ yyreduce:
       }
     break;
 
-  case 53:
-#line 926 "grammar.y"
+  case 54:
+#line 927 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_STRING, "matches");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_REGEXP, "matches");
@@ -2573,8 +2579,8 @@ yyreduce:
       }
     break;
 
-  case 54:
-#line 941 "grammar.y"
+  case 55:
+#line 942 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_STRING, "contains");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_STRING, "contains");
@@ -2590,8 +2596,8 @@ yyreduce:
       }
     break;
 
-  case 55:
-#line 955 "grammar.y"
+  case 56:
+#line 956 "grammar.y"
     {
         int result = yr_parser_reduce_string_identifier(
             yyscanner,
@@ -2607,8 +2613,8 @@ yyreduce:
       }
     break;
 
-  case 56:
-#line 969 "grammar.y"
+  case 57:
+#line 970 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "at");
 
@@ -2626,8 +2632,8 @@ yyreduce:
       }
     break;
 
-  case 57:
-#line 985 "grammar.y"
+  case 58:
+#line 986 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner,
@@ -2643,8 +2649,8 @@ yyreduce:
       }
     break;
 
-  case 58:
-#line 999 "grammar.y"
+  case 59:
+#line 1000 "grammar.y"
     {
         int var_index;
 
@@ -2682,8 +2688,8 @@ yyreduce:
       }
     break;
 
-  case 59:
-#line 1035 "grammar.y"
+  case 60:
+#line 1036 "grammar.y"
     {
         int mem_offset = LOOP_LOCAL_VARS * compiler->loop_depth;
         uint8_t* addr;
@@ -2720,8 +2726,8 @@ yyreduce:
       }
     break;
 
-  case 60:
-#line 1070 "grammar.y"
+  case 61:
+#line 1071 "grammar.y"
     {
         int mem_offset;
 
@@ -2804,8 +2810,8 @@ yyreduce:
       }
     break;
 
-  case 61:
-#line 1151 "grammar.y"
+  case 62:
+#line 1152 "grammar.y"
     {
         int mem_offset = LOOP_LOCAL_VARS * compiler->loop_depth;
         uint8_t* addr;
@@ -2837,8 +2843,8 @@ yyreduce:
       }
     break;
 
-  case 62:
-#line 1181 "grammar.y"
+  case 63:
+#line 1182 "grammar.y"
     {
         int mem_offset;
 
@@ -2890,8 +2896,8 @@ yyreduce:
       }
     break;
 
-  case 63:
-#line 1231 "grammar.y"
+  case 64:
+#line 1232 "grammar.y"
     {
         yr_parser_emit(yyscanner, OP_OF, NULL);
 
@@ -2899,8 +2905,8 @@ yyreduce:
       }
     break;
 
-  case 64:
-#line 1237 "grammar.y"
+  case 65:
+#line 1238 "grammar.y"
     {
         yr_parser_emit(yyscanner, OP_NOT, NULL);
 
@@ -2908,8 +2914,8 @@ yyreduce:
       }
     break;
 
-  case 65:
-#line 1243 "grammar.y"
+  case 66:
+#line 1244 "grammar.y"
     {
         int64_t* jmp_destination_addr;
 
@@ -2936,8 +2942,8 @@ yyreduce:
       }
     break;
 
-  case 66:
-#line 1268 "grammar.y"
+  case 67:
+#line 1269 "grammar.y"
     {
         uint8_t* and_addr;
 
@@ -2974,8 +2980,8 @@ yyreduce:
       }
     break;
 
-  case 67:
-#line 1303 "grammar.y"
+  case 68:
+#line 1304 "grammar.y"
     {
         int64_t* jmp_destination_addr;
 
@@ -3001,8 +3007,8 @@ yyreduce:
       }
     break;
 
-  case 68:
-#line 1327 "grammar.y"
+  case 69:
+#line 1328 "grammar.y"
     {
         uint8_t* or_addr;
 
@@ -3039,8 +3045,8 @@ yyreduce:
       }
     break;
 
-  case 69:
-#line 1362 "grammar.y"
+  case 70:
+#line 1363 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "<", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3051,8 +3057,8 @@ yyreduce:
       }
     break;
 
-  case 70:
-#line 1371 "grammar.y"
+  case 71:
+#line 1372 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, ">", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3063,8 +3069,8 @@ yyreduce:
       }
     break;
 
-  case 71:
-#line 1380 "grammar.y"
+  case 72:
+#line 1381 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "<=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3075,8 +3081,8 @@ yyreduce:
       }
     break;
 
-  case 72:
-#line 1389 "grammar.y"
+  case 73:
+#line 1390 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, ">=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3087,8 +3093,8 @@ yyreduce:
       }
     break;
 
-  case 73:
-#line 1398 "grammar.y"
+  case 74:
+#line 1399 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "==", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3099,8 +3105,8 @@ yyreduce:
       }
     break;
 
-  case 74:
-#line 1407 "grammar.y"
+  case 75:
+#line 1408 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "!=", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3111,32 +3117,32 @@ yyreduce:
       }
     break;
 
-  case 75:
-#line 1416 "grammar.y"
+  case 76:
+#line 1417 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(1) - (1)].expression);
       }
     break;
 
-  case 76:
-#line 1420 "grammar.y"
+  case 77:
+#line 1421 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(2) - (3)].expression);
       }
     break;
 
-  case 77:
-#line 1427 "grammar.y"
+  case 78:
+#line 1428 "grammar.y"
     { (yyval.integer) = INTEGER_SET_ENUMERATION; }
     break;
 
-  case 78:
-#line 1428 "grammar.y"
+  case 79:
+#line 1429 "grammar.y"
     { (yyval.integer) = INTEGER_SET_RANGE; }
     break;
 
-  case 79:
-#line 1434 "grammar.y"
+  case 80:
+#line 1435 "grammar.y"
     {
         if ((yyvsp[(2) - (5)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3156,8 +3162,8 @@ yyreduce:
       }
     break;
 
-  case 80:
-#line 1456 "grammar.y"
+  case 81:
+#line 1457 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3171,8 +3177,8 @@ yyreduce:
       }
     break;
 
-  case 81:
-#line 1468 "grammar.y"
+  case 82:
+#line 1469 "grammar.y"
     {
         if ((yyvsp[(3) - (3)].expression).type != EXPRESSION_TYPE_INTEGER)
         {
@@ -3185,61 +3191,61 @@ yyreduce:
       }
     break;
 
-  case 82:
-#line 1483 "grammar.y"
+  case 83:
+#line 1484 "grammar.y"
     {
         // Push end-of-list marker
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
       }
     break;
 
-  case 84:
-#line 1489 "grammar.y"
+  case 85:
+#line 1490 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
         yr_parser_emit_pushes_for_strings(yyscanner, "$*");
       }
     break;
 
-  case 87:
-#line 1504 "grammar.y"
+  case 88:
+#line 1505 "grammar.y"
     {
         yr_parser_emit_pushes_for_strings(yyscanner, (yyvsp[(1) - (1)].c_string));
         yr_free((yyvsp[(1) - (1)].c_string));
       }
     break;
 
-  case 88:
-#line 1509 "grammar.y"
+  case 89:
+#line 1510 "grammar.y"
     {
         yr_parser_emit_pushes_for_strings(yyscanner, (yyvsp[(1) - (1)].c_string));
         yr_free((yyvsp[(1) - (1)].c_string));
       }
     break;
 
-  case 90:
-#line 1519 "grammar.y"
+  case 91:
+#line 1520 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, UNDEFINED, NULL, NULL);
       }
     break;
 
-  case 91:
-#line 1523 "grammar.y"
+  case 92:
+#line 1524 "grammar.y"
     {
         yr_parser_emit_with_arg(yyscanner, OP_PUSH, 1, NULL, NULL);
       }
     break;
 
-  case 92:
-#line 1531 "grammar.y"
+  case 93:
+#line 1532 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(2) - (3)].expression);
       }
     break;
 
-  case 93:
-#line 1535 "grammar.y"
+  case 94:
+#line 1536 "grammar.y"
     {
         compiler->last_result = yr_parser_emit(
             yyscanner, OP_FILESIZE, NULL);
@@ -3251,8 +3257,8 @@ yyreduce:
       }
     break;
 
-  case 94:
-#line 1545 "grammar.y"
+  case 95:
+#line 1546 "grammar.y"
     {
         yywarning(yyscanner,
             "Using deprecated \"entrypoint\" keyword. Use the \"entry_point\" "
@@ -3268,8 +3274,8 @@ yyreduce:
       }
     break;
 
-  case 95:
-#line 1559 "grammar.y"
+  case 96:
+#line 1560 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(3) - (4)].expression), EXPRESSION_TYPE_INTEGER, "intXXXX or uintXXXX");
 
@@ -3287,8 +3293,8 @@ yyreduce:
       }
     break;
 
-  case 96:
-#line 1575 "grammar.y"
+  case 97:
+#line 1576 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner, OP_PUSH, (yyvsp[(1) - (1)].integer), NULL, NULL);
@@ -3300,8 +3306,8 @@ yyreduce:
       }
     break;
 
-  case 97:
-#line 1585 "grammar.y"
+  case 98:
+#line 1586 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg_double(
             yyscanner, OP_PUSH, (yyvsp[(1) - (1)].double_), NULL, NULL);
@@ -3312,8 +3318,8 @@ yyreduce:
       }
     break;
 
-  case 98:
-#line 1594 "grammar.y"
+  case 99:
+#line 1595 "grammar.y"
     {
         SIZED_STRING* sized_string;
 
@@ -3339,8 +3345,8 @@ yyreduce:
       }
     break;
 
-  case 99:
-#line 1618 "grammar.y"
+  case 100:
+#line 1619 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner,
@@ -3357,8 +3363,8 @@ yyreduce:
       }
     break;
 
-  case 100:
-#line 1633 "grammar.y"
+  case 101:
+#line 1634 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_string_identifier(
             yyscanner,
@@ -3375,8 +3381,8 @@ yyreduce:
       }
     break;
 
-  case 101:
-#line 1648 "grammar.y"
+  case 102:
+#line 1649 "grammar.y"
     {
         compiler->last_result = yr_parser_emit_with_arg(
             yyscanner,
@@ -3401,8 +3407,8 @@ yyreduce:
       }
     break;
 
-  case 102:
-#line 1671 "grammar.y"
+  case 103:
+#line 1672 "grammar.y"
     {
         if ((yyvsp[(1) - (1)].expression).type == EXPRESSION_TYPE_INTEGER)  // loop identifier
         {
@@ -3448,8 +3454,8 @@ yyreduce:
       }
     break;
 
-  case 103:
-#line 1715 "grammar.y"
+  case 104:
+#line 1716 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(2) - (2)].expression), EXPRESSION_TYPE_INTEGER | EXPRESSION_TYPE_FLOAT, "-");
 
@@ -3470,8 +3476,8 @@ yyreduce:
       }
     break;
 
-  case 104:
-#line 1734 "grammar.y"
+  case 105:
+#line 1735 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "+", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3491,8 +3497,8 @@ yyreduce:
       }
     break;
 
-  case 105:
-#line 1752 "grammar.y"
+  case 106:
+#line 1753 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "-", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3512,8 +3518,8 @@ yyreduce:
       }
     break;
 
-  case 106:
-#line 1770 "grammar.y"
+  case 107:
+#line 1771 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "*", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3533,8 +3539,8 @@ yyreduce:
       }
     break;
 
-  case 107:
-#line 1788 "grammar.y"
+  case 108:
+#line 1789 "grammar.y"
     {
         compiler->last_result = yr_parser_reduce_operation(
             yyscanner, "\\", (yyvsp[(1) - (3)].expression), (yyvsp[(3) - (3)].expression));
@@ -3544,8 +3550,16 @@ yyreduce:
         if ((yyvsp[(1) - (3)].expression).type == EXPRESSION_TYPE_INTEGER &&
             (yyvsp[(3) - (3)].expression).type == EXPRESSION_TYPE_INTEGER)
         {
-          (yyval.expression).value.integer = OPERATION(/, (yyvsp[(1) - (3)].expression).value.integer, (yyvsp[(3) - (3)].expression).value.integer);
-          (yyval.expression).type = EXPRESSION_TYPE_INTEGER;
+          if ((yyvsp[(3) - (3)].expression).value.integer != 0)
+          {
+            (yyval.expression).value.integer = OPERATION(/, (yyvsp[(1) - (3)].expression).value.integer, (yyvsp[(3) - (3)].expression).value.integer);
+            (yyval.expression).type = EXPRESSION_TYPE_INTEGER;
+          }
+          else
+          {
+            compiler->last_result = ERROR_DIVISION_BY_ZERO;
+            ERROR_IF(compiler->last_result != ERROR_SUCCESS);
+          }
         }
         else
         {
@@ -3554,21 +3568,29 @@ yyreduce:
       }
     break;
 
-  case 108:
-#line 1806 "grammar.y"
+  case 109:
+#line 1815 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "%");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "%");
 
         yr_parser_emit(yyscanner, OP_MOD, NULL);
 
-        (yyval.expression).type = EXPRESSION_TYPE_INTEGER;
-        (yyval.expression).value.integer = OPERATION(%, (yyvsp[(1) - (3)].expression).value.integer, (yyvsp[(3) - (3)].expression).value.integer);
+        if ((yyvsp[(3) - (3)].expression).value.integer != 0)
+        {
+          (yyval.expression).value.integer = OPERATION(%, (yyvsp[(1) - (3)].expression).value.integer, (yyvsp[(3) - (3)].expression).value.integer);
+          (yyval.expression).type = EXPRESSION_TYPE_INTEGER;
+        }
+        else
+        {
+          compiler->last_result = ERROR_DIVISION_BY_ZERO;
+          ERROR_IF(compiler->last_result != ERROR_SUCCESS);
+        }
       }
     break;
 
-  case 109:
-#line 1816 "grammar.y"
+  case 110:
+#line 1833 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
@@ -3580,8 +3602,8 @@ yyreduce:
       }
     break;
 
-  case 110:
-#line 1826 "grammar.y"
+  case 111:
+#line 1843 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "^");
@@ -3593,8 +3615,8 @@ yyreduce:
       }
     break;
 
-  case 111:
-#line 1836 "grammar.y"
+  case 112:
+#line 1853 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "|");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "|");
@@ -3606,8 +3628,8 @@ yyreduce:
       }
     break;
 
-  case 112:
-#line 1846 "grammar.y"
+  case 113:
+#line 1863 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(2) - (2)].expression), EXPRESSION_TYPE_INTEGER, "~");
 
@@ -3619,8 +3641,8 @@ yyreduce:
       }
     break;
 
-  case 113:
-#line 1856 "grammar.y"
+  case 114:
+#line 1873 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, "<<");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, "<<");
@@ -3632,8 +3654,8 @@ yyreduce:
       }
     break;
 
-  case 114:
-#line 1866 "grammar.y"
+  case 115:
+#line 1883 "grammar.y"
     {
         CHECK_TYPE((yyvsp[(1) - (3)].expression), EXPRESSION_TYPE_INTEGER, ">>");
         CHECK_TYPE((yyvsp[(3) - (3)].expression), EXPRESSION_TYPE_INTEGER, ">>");
@@ -3645,8 +3667,8 @@ yyreduce:
       }
     break;
 
-  case 115:
-#line 1876 "grammar.y"
+  case 116:
+#line 1893 "grammar.y"
     {
         (yyval.expression) = (yyvsp[(1) - (1)].expression);
       }
@@ -3654,7 +3676,7 @@ yyreduce:
 
 
 /* Line 1267 of yacc.c.  */
-#line 3658 "grammar.c"
+#line 3680 "grammar.c"
       default: break;
     }
   YY_SYMBOL_PRINT ("-> $$ =", yyr1[yyn], &yyval, &yyloc);
@@ -3868,6 +3890,6 @@ yyreturn:
 }
 
 
-#line 1881 "grammar.y"
+#line 1898 "grammar.y"
 
 
diff --git a/libyara/grammar.y b/libyara/grammar.y
index 159902b..5e7d60d 100644
--- a/libyara/grammar.y
+++ b/libyara/grammar.y
@@ -166,9 +166,9 @@ limitations under the License.
 %type <expression> identifier
 %type <expression> regexp
 
+%type <c_string> arguments
 %type <c_string> arguments_list
 
-
 %destructor { yr_free($$); } _IDENTIFIER_
 %destructor { yr_free($$); } _STRING_IDENTIFIER_
 %destructor { yr_free($$); } _STRING_COUNT_
@@ -729,7 +729,7 @@ identifier
         ERROR_IF(compiler->last_result != ERROR_SUCCESS);
       }
 
-    | identifier '(' arguments_list ')'
+    | identifier '(' arguments ')'
       {
         char* args_fmt;
 
@@ -775,12 +775,13 @@ identifier
     ;
 
 
+arguments
+    : /* empty */     { $$ = yr_strdup(""); }
+    | arguments_list  { $$ = $1; }
+
+
 arguments_list
-    : /* empty */
-      {
-        $$ = yr_strdup("");
-      }
-    | expression
+    : expression
       {
         $$ = (char*) yr_malloc(MAX_FUNCTION_ARGS + 1);
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/forensics/yara.git



More information about the forensics-changes mailing list