CVE-2023-46046: Insufficient Information (NVD-CWE-noinfo)
value: An issue in MiniZinc before 2.8.0 allows a NULL pointer dereference via ti_expr in a crafted .mzn file. NOTE: this is disputed because there is no common libminizinc use case in which an unattended process is supposed to run forever to process a series of atttacker-controlled .mzn files.
CWE description: There is insufficient information about the issue to classify it; details are unkown or unspecified.
Published: 2024-03-27T05:15Z
Repository: https://github.com/MiniZinc/libminizinc
Language: C++
Files changed: changes.rst, lib/cached/md5_cached.cmake, lib/cached/minizinc/parser.tab.hh, lib/cached/parser.tab.cpp, lib/parser.yxx, tests/spec/unit/regression/github_730.mzn
Commit date: 2023-09-13 09:08:44 +1000
Commit message: Fix missing nullptr check in ti_expr in the parser

Resolves #730 on GitHub

Diff: diff --git a/changes.rst b/changes.rst
index 5f75bf02..5247d1e4 100644
--- a/changes.rst
+++ b/changes.rst
@@ -61,10 +61,12 @@ Bug fixes:
    before they are output (:bugref:`725`).
 -  Fix problem where argument names of generated functions could conflict with
    model declared names (:bugref:`726`).
 -  Fix problem where the common type of complex records or tuples was not
    correctly determined in the array literals.
+-  Fix a problem in the parser where a nullptr would be used before a syntax
+   error was thrown (:bugref:`730`).
 
 .. _v2.7.6:
 
 `Version 2.7.6 <https://github.com/MiniZinc/MiniZincIDE/releases/tag/2.7.6>`__
 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
diff --git a/lib/cached/md5_cached.cmake b/lib/cached/md5_cached.cmake
index fa99d539..da4c2e16 100644
--- a/lib/cached/md5_cached.cmake
+++ b/lib/cached/md5_cached.cmake
@@ -1,4 +1,4 @@
 set(lexer_lxx_md5_cached "463d007a1f237dd01cb3020208efda3c")
-set(parser_yxx_md5_cached "a1a3ad0d5717f0cc50417099ff2ae02f")
+set(parser_yxx_md5_cached "a49d72232e30c06667be4eb862bc67eb")
 set(regex_lexer_lxx_md5_cached "8906a52bfa0c5ae26354cb272348e656")
 set(regex_parser_yxx_md5_cached "68ec070becef5e161c3b97d085b0810e")
\ No newline at end of file
diff --git a/lib/cached/minizinc/parser.tab.hh b/lib/cached/minizinc/parser.tab.hh
index 2c5e6b62..bf07eff9 100644
--- a/lib/cached/minizinc/parser.tab.hh
+++ b/lib/cached/minizinc/parser.tab.hh
@@ -1,6 +1,6 @@
-/* A Bison parser, made by GNU Bison 3.7.6.  */
+/* A Bison parser, made by GNU Bison 3.8.2.  */
 
 /* Bison interface for Yacc-like parsers in C
 
    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
    Inc.
@@ -33,12 +33,12 @@
 
 /* DO NOT RELY ON FEATURES THAT ARE NOT DOCUMENTED in the manual,
    especially those whose name start with YY_ or yy_.  They are
    private implementation details that can be changed or removed.  */
 
-#ifndef YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
-# define YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
+#ifndef YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
+# define YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
 /* Debug traces.  */
 #ifndef YYDEBUG
 # define YYDEBUG 0
 #endif
 #if YYDEBUG
@@ -243,8 +243,10 @@ struct YYLTYPE
 # define YYLTYPE_IS_TRIVIAL 1
 #endif
 
 
 
+
 int mzn_yyparse (void *parm);
 
-#endif /* !YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED  */
+
+#endif /* !YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED  */
diff --git a/lib/cached/parser.tab.cpp b/lib/cached/parser.tab.cpp
index 3ffe458a..3fa12911 100644
--- a/lib/cached/parser.tab.cpp
+++ b/lib/cached/parser.tab.cpp
@@ -1,6 +1,6 @@
-/* A Bison parser, made by GNU Bison 3.7.6.  */
+/* A Bison parser, made by GNU Bison 3.8.2.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
    Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2021 Free Software Foundation,
    Inc.
@@ -44,14 +44,14 @@
    There are some unavoidable exceptions within include files to
    define necessary library symbols; they are noted "INFRINGES ON
    USER NAME SPACE" below.  */
 
 /* Identify Bison output, and Bison version.  */
-#define YYBISON 30706
+#define YYBISON 30802
 
 /* Bison version string.  */
-#define YYBISON_VERSION "3.7.6"
+#define YYBISON_VERSION "3.8.2"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
 
 /* Pure parsers.  */
@@ -657,16 +657,22 @@ typedef int yy_state_fast_t;
 # define YY_USE(E) ((void) (E))
 #else
 # define YY_USE(E) /* empty */
 #endif
 
-#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
 /* Suppress an incorrect diagnostic about yylval being uninitialized.  */
-# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
+#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
+# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
+#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
+    _Pragma ("GCC diagnostic push")                                     \
+    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
+# else
+#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
     _Pragma ("GCC diagnostic push")                                     \
     _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")              \
     _Pragma ("GCC diagnostic ignored \"-Wmaybe-uninitialized\"")
+# endif
 # define YY_IGNORE_MAYBE_UNINITIALIZED_END      \
     _Pragma ("GCC diagnostic pop")
 #else
 # define YY_INITIAL_VALUE(Value) Value
 #endif
@@ -893,11 +899,11 @@ static const yytype_uint8 yytranslate[] =
      125,   126,   127,   128,   129,   130,   131,   132,   133,   134,
      135,   136,   137,   138,   139,   140,   141,   142,   143
 };
 
 #if YYDEBUG
-  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
+/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_int16 yyrline[] =
 {
        0,   372,   372,   374,   376,   379,   388,   397,   406,   415,
      417,   420,   428,   437,   437,   439,   455,   459,   461,   463,
      464,   466,   468,   470,   472,   474,   477,   477,   477,   478,
@@ -905,47 +911,47 @@ static const yytype_int16 yyrline[] =
      549,   563,   575,   579,   588,   593,   599,   606,   607,   611,
      619,   620,   624,   628,   634,   636,   643,   648,   653,   660,
      662,   671,   682,   693,   704,   717,   731,   747,   760,   770,
      771,   781,   782,   787,   788,   790,   795,   796,   800,   811,
      823,   823,   824,   824,   827,   829,   833,   843,   847,   849,
-     852,   856,   858,   862,   863,   869,   876,   888,   891,   900,
-     912,   925,   933,   943,   956,   970,   974,   979,   980,   984,
-     986,   988,   990,   992,   994,  1001,  1011,  1013,  1018,  1024,
-    1027,  1029,  1033,  1035,  1037,  1039,  1041,  1044,  1047,  1049,
-    1055,  1056,  1058,  1060,  1062,  1064,  1073,  1075,  1077,  1079,
-    1081,  1083,  1085,  1087,  1089,  1091,  1093,  1095,  1097,  1099,
-    1101,  1110,  1112,  1114,  1116,  1118,  1120,  1122,  1124,  1126,
-    1128,  1130,  1132,  1134,  1139,  1144,  1149,  1154,  1159,  1164,
-    1169,  1175,  1181,  1183,  1196,  1197,  1199,  1201,  1203,  1205,
-    1207,  1209,  1211,  1213,  1215,  1217,  1219,  1221,  1223,  1225,
-    1227,  1229,  1231,  1233,  1235,  1244,  1246,  1248,  1250,  1252,
-    1254,  1256,  1258,  1260,  1262,  1264,  1266,  1268,  1270,  1272,
-    1281,  1283,  1285,  1287,  1289,  1291,  1293,  1295,  1297,  1299,
-    1301,  1303,  1305,  1307,  1312,  1317,  1322,  1327,  1332,  1337,
-    1342,  1347,  1353,  1355,  1362,  1374,  1376,  1380,  1382,  1384,
-    1386,  1388,  1390,  1393,  1395,  1398,  1400,  1403,  1405,  1408,
-    1410,  1412,  1414,  1416,  1418,  1420,  1422,  1424,  1426,  1428,
-    1429,  1432,  1434,  1437,  1438,  1441,  1443,  1446,  1447,  1450,
-    1452,  1455,  1456,  1459,  1461,  1464,  1465,  1468,  1470,  1473,
-    1474,  1477,  1479,  1482,  1483,  1484,  1487,  1488,  1491,  1492,
-    1495,  1497,  1500,  1501,  1504,  1506,  1511,  1513,  1519,  1524,
-    1532,  1541,  1547,  1556,  1565,  1567,  1572,  1577,  1591,  1599,
-    1601,  1605,  1612,  1618,  1621,  1624,  1626,  1628,  1634,  1636,
-    1638,  1646,  1648,  1651,  1654,  1657,  1659,  1661,  1663,  1667,
-    1669,  1716,  1718,  1779,  1819,  1822,  1827,  1834,  1839,  1842,
-    1845,  1855,  1867,  1878,  1881,  1885,  1896,  1907,  1926,  1933,
-    1937,  1940,  1944,  1955,  1975,  1982,  1998,  1999,  2003,  2005,
-    2007,  2009,  2011,  2013,  2015,  2017,  2019,  2021,  2023,  2025,
-    2027,  2029,  2031,  2033,  2035,  2037,  2039,  2041,  2043,  2045,
-    2047,  2049,  2051,  2053,  2055,  2057,  2061,  2069,  2101,  2103,
-    2105,  2106,  2126,  2180,  2200,  2255,  2258,  2264,  2270,  2272,
-    2276,  2278,  2285,  2294,  2296,  2304,  2306,  2315,  2315,  2318,
-    2326,  2337,  2338,  2341,  2343,  2345,  2349,  2353,  2357,  2359,
-    2361,  2363,  2365,  2367,  2369,  2371,  2373,  2375,  2377,  2379,
-    2381,  2383,  2385,  2387,  2389,  2391,  2393,  2395,  2397,  2399,
-    2401,  2403,  2405,  2407,  2409,  2411,  2413,  2415,  2417,  2419,
-    2421,  2423
+     852,   856,   858,   862,   863,   871,   880,   894,   897,   906,
+     918,   931,   939,   949,   962,   976,   980,   985,   986,   990,
+     992,   994,   996,   998,  1000,  1007,  1017,  1019,  1024,  1030,
+    1033,  1035,  1039,  1041,  1043,  1045,  1047,  1050,  1053,  1055,
+    1061,  1062,  1064,  1066,  1068,  1070,  1079,  1081,  1083,  1085,
+    1087,  1089,  1091,  1093,  1095,  1097,  1099,  1101,  1103,  1105,
+    1107,  1116,  1118,  1120,  1122,  1124,  1126,  1128,  1130,  1132,
+    1134,  1136,  1138,  1140,  1145,  1150,  1155,  1160,  1165,  1170,
+    1175,  1181,  1187,  1189,  1202,  1203,  1205,  1207,  1209,  1211,
+    1213,  1215,  1217,  1219,  1221,  1223,  1225,  1227,  1229,  1231,
+    1233,  1235,  1237,  1239,  1241,  1250,  1252,  1254,  1256,  1258,
+    1260,  1262,  1264,  1266,  1268,  1270,  1272,  1274,  1276,  1278,
+    1287,  1289,  1291,  1293,  1295,  1297,  1299,  1301,  1303,  1305,
+    1307,  1309,  1311,  1313,  1318,  1323,  1328,  1333,  1338,  1343,
+    1348,  1353,  1359,  1361,  1368,  1380,  1382,  1386,  1388,  1390,
+    1392,  1394,  1396,  1399,  1401,  1404,  1406,  1409,  1411,  1414,
+    1416,  1418,  1420,  1422,  1424,  1426,  1428,  1430,  1432,  1434,
+    1435,  1438,  1440,  1443,  1444,  1447,  1449,  1452,  1453,  1456,
+    1458,  1461,  1462,  1465,  1467,  1470,  1471,  1474,  1476,  1479,
+    1480,  1483,  1485,  1488,  1489,  1490,  1493,  1494,  1497,  1498,
+    1501,  1503,  1506,  1507,  1510,  1512,  1517,  1519,  1525,  1530,
+    1538,  1547,  1553,  1562,  1571,  1573,  1578,  1583,  1597,  1605,
+    1607,  1611,  1618,  1624,  1627,  1630,  1632,  1634,  1640,  1642,
+    1644,  1652,  1654,  1657,  1660,  1663,  1665,  1667,  1669,  1673,
+    1675,  1722,  1724,  1785,  1825,  1828,  1833,  1840,  1845,  1848,
+    1851,  1861,  1873,  1884,  1887,  1891,  1902,  1913,  1932,  1939,
+    1943,  1946,  1950,  1961,  1981,  1988,  2004,  2005,  2009,  2011,
+    2013,  2015,  2017,  2019,  2021,  2023,  2025,  2027,  2029,  2031,
+    2033,  2035,  2037,  2039,  2041,  2043,  2045,  2047,  2049,  2051,
+    2053,  2055,  2057,  2059,  2061,  2063,  2067,  2075,  2107,  2109,
+    2111,  2112,  2132,  2186,  2206,  2261,  2264,  2270,  2276,  2278,
+    2282,  2284,  2291,  2300,  2302,  2310,  2312,  2321,  2321,  2324,
+    2332,  2343,  2344,  2347,  2349,  2351,  2355,  2359,  2363,  2365,
+    2367,  2369,  2371,  2373,  2375,  2377,  2379,  2381,  2383,  2385,
+    2387,  2389,  2391,  2393,  2395,  2397,  2399,  2401,  2403,  2405,
+    2407,  2409,  2411,  2413,  2415,  2417,  2419,  2421,  2423,  2425,
+    2427,  2429
 };
 #endif
 
 /** Accessing symbol of state STATE.  */
 #define YY_ACCESSING_SYMBOL(State) YY_CAST (yysymbol_kind_t, yystos[State])
@@ -1026,46 +1032,22 @@ yysymbol_name (yysymbol_kind_t yysymbol)
 {
   return yytname[yysymbol];
 }
 #endif
 
-#ifdef YYPRINT
-/* YYTOKNUM[NUM] -- (External) token number corresponding to the
-   (internal) symbol number NUM (which must be that of a token).  */
-static const yytype_int16 yytoknum[] =
-{
-       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
-     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
-     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
-     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
-     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
-     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
-     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
-     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
-     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
-     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
-     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
-     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
-     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
-     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
-     395,   396,   397,   398,    59,   123,   125,    40,    41,    44,
-      58,   124
-};
-#endif
-
 #define YYPACT_NINF (-616)
 
 #define yypact_value_is_default(Yyn) \
   ((Yyn) == YYPACT_NINF)
 
 #define YYTABLE_NINF (-77)
 
 #define yytable_value_is_error(Yyn) \
   ((Yyn) == YYTABLE_NINF)
 
-  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
-     STATE-NUM.  */
+/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
+   STATE-NUM.  */
 static const yytype_int16 yypact[] =
 {
     1171,  -121,   -68,   -62,   -53,    16,  -616,  4220,  -616,  -616,
     2335,  -616,     4,     4,   -34,  -616,    67,    76,    34,  -616,
     3640,   101,  -616,  2770,  4220,   109,    55,  -616,   -26,   124,
@@ -1143,13 +1125,13 @@ static const yytype_int16 yypact[] =
      465,   473,   334,  -616,   350,  7699,  7798,  7839,  -616,  7839,
     -616,  -616,  4220,  4220,    87,  -616,  -616,  -616,  -616,  -616,
     -616,  -616,  -616,  4220,  7839,  7839,   350,  7839,  -616
 };
 
-  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
-     Performed when YYTABLE does not specify something else to do.  Zero
-     means the default is an error.  */
+/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
+   Performed when YYTABLE does not specify something else to do.  Zero
+   means the default is an error.  */
 static const yytype_int16 yydefact[] =
 {
        0,     0,   251,   249,   255,   241,   296,     0,   117,   118,
        0,    11,   107,   107,   257,   113,     0,   106,     0,   110,
        0,     0,   111,     0,     0,     0,   253,   109,     0,     0,
@@ -1227,11 +1209,11 @@ static const yytype_int16 yydefact[] =
        0,    81,     0,    43,    71,     0,     0,   402,    63,    72,
       64,   347,     0,     0,   411,   394,    45,    46,    49,    52,
       44,    65,   355,     0,   320,   322,    71,   357,    66
 };
 
-  /* YYPGOTO[NTERM-NUM].  */
+/* YYPGOTO[NTERM-NUM].  */
 static const yytype_int16 yypgoto[] =
 {
     -616,  -616,  -616,  -616,   274,  -616,   -77,   474,  -616,  -616,
     -616,  -616,  -217,  -616,  -616,  -616,  -154,  -616,  -616,  -616,
     -616,  -616,  -327,  -615,  -134,  -126,  -616,  -110,  -616,  -147,
@@ -1241,11 +1223,11 @@ static const yytype_int16 yypgoto[] =
     -171,  -170,  -616,  -616,  -616,  -616,  -616,   -92,  -616,  -616,
      147,   155,  -616,  -616,  -616,  -616,  -616,  -616,  -616,  -616,
      229,  -616,  -616,  -616,  -616,   -52,   -33,  -214,  -616,  -616
 };
 
-  /* YYDEFGOTO[NTERM-NUM].  */
+/* YYDEFGOTO[NTERM-NUM].  */
 static const yytype_int16 yydefgoto[] =
 {
        0,    83,    84,    85,    86,   208,    87,    88,   220,    89,
       90,   645,   646,   699,   701,    91,    92,    93,    94,    95,
       96,    97,   568,   711,   346,   511,   512,   397,   394,   513,
@@ -1255,13 +1237,13 @@ static const yytype_int16 yydefgoto[] =
      585,   586,   587,   588,   110,   111,   183,   389,   184,   185,
      186,   187,   112,   178,   179,   113,   650,   114,   115,   116,
      281,   282,   117,   358,   563,   359,   615,   372,   170,   555
 };
 
-  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
-     positive, shift that token.  If negative, reduce the rule whose
-     number is the opposite.  If YYTABLE_NINF, syntax error.  */
+/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
+   positive, shift that token.  If negative, reduce the rule whose
+   number is the opposite.  If YYTABLE_NINF, syntax error.  */
 static const yytype_int16 yytable[] =
 {
      153,   199,   169,   360,   156,   355,   356,   155,   162,   210,
      175,   164,   604,   365,   390,   641,   297,   298,   122,   641,
      168,   177,   182,   118,   188,   189,   190,   191,   192,   193,
@@ -2936,12 +2918,12 @@ static const yytype_int16 yycheck[] =
       84,    85,    86,    87,    88,    89,    90,    91,    92,    93,
       94,    95,    96,    97,    98,    99,   100,   101,   102,   103,
      104,   105,    -1,    -1,   108,   109
 };
 
-  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
-     symbol of state STATE-NUM.  */
+/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
+   state STATE-NUM.  */
 static const yytype_uint8 yystos[] =
 {
        0,     1,     3,     4,     5,     6,     8,     9,    12,    13,
       14,    15,    17,    18,    19,    20,    21,    22,    23,    24,
       26,    31,    32,    33,    34,    35,    36,    37,    38,    39,
@@ -3019,11 +3001,11 @@ static const yytype_uint8 yystos[] =
      149,   149,   179,   164,   238,   197,   197,   197,   175,   197,
      175,    60,    57,    57,   174,   148,   148,   148,     8,     6,
      146,   175,    30,    52,   197,   197,   238,   197,   175
 };
 
-  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
+/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
 static const yytype_uint8 yyr1[] =
 {
        0,   152,   153,   154,   154,   155,   155,   155,   155,   155,
      155,   156,   156,   157,   157,   158,   158,   159,   159,   159,
      159,   159,   159,   159,   159,   159,   160,   160,   160,   160,
@@ -3070,11 +3052,11 @@ static const yytype_uint8 yyr1[] =
      241,   241,   241,   241,   241,   241,   241,   241,   241,   241,
      241,   241,   241,   241,   241,   241,   241,   241,   241,   241,
      241,   241
 };
 
-  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
+/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
 static const yytype_int8 yyr2[] =
 {
        0,     2,     1,     0,     2,     1,     2,     3,     4,     2,
        3,     1,     2,     0,     1,     2,     1,     1,     1,     1,
        1,     1,     1,     1,     1,     1,     1,     1,     1,     1,
@@ -3130,10 +3112,11 @@ enum { YYENOMEM = -2 };
 #define yyclearin       (yychar = YYEMPTY)
 
 #define YYACCEPT        goto yyacceptlab
 #define YYABORT         goto yyabortlab
 #define YYERROR         goto yyerrorlab
+#define YYNOMEM         goto yyexhaustedlab
 
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
 #define YYBACKUP(Token, Value)                                    \
@@ -3197,16 +3180,23 @@ do {                                            \
   if (yydebug)                                  \
     YYFPRINTF Args;                             \
 } while (0)
 
 
-/* YY_LOCATION_PRINT -- Print the location on the stream.
+/* YYLOCATION_PRINT -- Print the location on the stream.
    This macro was not mandated originally: define only if we know
    we won't break user code: when these are the locations we know.  */
 
-# ifndef YY_LOCATION_PRINT
-#  if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
+# ifndef YYLOCATION_PRINT
+
+#  if defined YY_LOCATION_PRINT
+
+   /* Temporary convenience wrapper in case some people defined the
+      undocumented and private YY_LOCATION_PRINT macros.  */
+#   define YYLOCATION_PRINT(File, Loc)  YY_LOCATION_PRINT(File, *(Loc))
+
+#  elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 
 /* Print *YYLOCP on YYO.  Private, do not rely on its existence. */
 
 YY_ATTRIBUTE_UNUSED
 static int
@@ -3230,19 +3220,27 @@ yy_location_print_ (FILE *yyo, YYLTYPE const * const yylocp)
         }
       else if (0 <= end_col && yylocp->first_column < end_col)
         res += YYFPRINTF (yyo, "-%d", end_col);
     }
   return res;
- }
+}
+
+#   define YYLOCATION_PRINT  yy_location_print_
 
-#   define YY_LOCATION_PRINT(File, Loc)          \
-  yy_location_print_ (File, &(Loc))
+    /* Temporary convenience wrapper in case some people defined the
+       undocumented and private YY_LOCATION_PRINT macros.  */
+#   define YY_LOCATION_PRINT(File, Loc)  YYLOCATION_PRINT(File, &(Loc))
 
 #  else
-#   define YY_LOCATION_PRINT(File, Loc) ((void) 0)
+
+#   define YYLOCATION_PRINT(File, Loc) ((void) 0)
+    /* Temporary convenience wrapper in case some people defined the
+       undocumented and private YY_LOCATION_PRINT macros.  */
+#   define YY_LOCATION_PRINT  YYLOCATION_PRINT
+
 #  endif
-# endif /* !defined YY_LOCATION_PRINT */
+# endif /* !defined YYLOCATION_PRINT */
 
 
 # define YY_SYMBOL_PRINT(Title, Kind, Value, Location)                    \
 do {                                                                      \
   if (yydebug)                                                            \
@@ -3267,14 +3265,10 @@ yy_symbol_value_print (FILE *yyo,
   YY_USE (yyoutput);
   YY_USE (yylocationp);
   YY_USE (parm);
   if (!yyvaluep)
     return;
-# ifdef YYPRINT
-  if (yykind < YYNTOKENS)
-    YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
-# endif
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   YY_USE (yykind);
   YY_IGNORE_MAYBE_UNINITIALIZED_END
 }
 
@@ -3288,11 +3282,11 @@ yy_symbol_print (FILE *yyo,
                  yysymbol_kind_t yykind, YYSTYPE const * const yyvaluep, YYLTYPE const * const yylocationp, void *parm)
 {
   YYFPRINTF (yyo, "%s %s (",
              yykind < YYNTOKENS ? "token" : "nterm", yysymbol_name (yykind));
 
-  YY_LOCATION_PRINT (yyo, *yylocationp);
+  YYLOCATION_PRINT (yyo, yylocationp);
   YYFPRINTF (yyo, ": ");
   yy_symbol_value_print (yyo, yykind, yyvaluep, yylocationp, parm);
   YYFPRINTF (yyo, ")");
 }
 
@@ -3755,10 +3749,11 @@ YYLTYPE yylloc = yyloc_default;
 
   YYDPRINTF ((stderr, "Starting parse\n"));
 
   yychar = YYEMPTY; /* Cause a token to be read.  */
 
+
 /* User initialization code.  */
 {
   GCLock lock;
   yylloc.filename(ASTString(static_cast<ParserState*>(parm)->filename));
 }
@@ -3788,11 +3783,11 @@ yysetstate:
   YY_IGNORE_USELESS_CAST_END
   YY_STACK_PRINT (yyss, yyssp);
 
   if (yyss + yystacksize - 1 <= yyssp)
 #if !defined yyoverflow && !defined YYSTACK_RELOCATE
-    goto yyexhaustedlab;
+    YYNOMEM;
 #else
     {
       /* Get the current used size of the three stacks, in elements.  */
       YYPTRDIFF_T yysize = yyssp - yyss + 1;
 
@@ -3819,22 +3814,22 @@ yysetstate:
         yyls = yyls1;
       }
 # else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
-        goto yyexhaustedlab;
+        YYNOMEM;
       yystacksize *= 2;
       if (YYMAXDEPTH < yystacksize)
         yystacksize = YYMAXDEPTH;
 
       {
         yy_state_t *yyss1 = yyss;
         union yyalloc *yyptr =
           YY_CAST (union yyalloc *,
                    YYSTACK_ALLOC (YY_CAST (YYSIZE_T, YYSTACK_BYTES (yystacksize))));
         if (! yyptr)
-          goto yyexhaustedlab;
+          YYNOMEM;
         YYSTACK_RELOCATE (yyss_alloc, yyss);
         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
         YYSTACK_RELOCATE (yyls_alloc, yyls);
 #  undef YYSTACK_RELOCATE
         if (yyss1 != yyssa)
@@ -3854,10 +3849,11 @@ yysetstate:
       if (yyss + yystacksize - 1 <= yyssp)
         YYABORT;
     }
 #endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
+
   if (yystate == YYFINAL)
     YYACCEPT;
 
   goto yybackup;
 
@@ -4532,55 +4528,61 @@ yyreduce:
     break;
 
   case 94: /* ti_expr: "array" "[" ti_expr_list "]" "of" base_ti_expr  */
       {
         (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr) && (yyvsp[-3].tiexprs)) (yyval.tiexpr)->setRanges(*(yyvsp[-3].tiexprs));
+        if ((yyval.tiexpr) != nullptr && (yyvsp[-3].tiexprs) != nullptr) {
+          (yyval.tiexpr)->setRanges(*(yyvsp[-3].tiexprs));
+        }
         delete (yyvsp[-3].tiexprs);
       }
     break;
 
   case 95: /* ti_expr: "list" "of" base_ti_expr  */
       {
         (yyval.tiexpr) = (yyvsp[0].tiexpr);
         std::vector<TypeInst*> ti(1);
         ti[0] = new TypeInst((yyloc),Type::parint());
-        if ((yyval.tiexpr)) (yyval.tiexpr)->setRanges(ti);
+        if ((yyval.tiexpr) != nullptr){
+          (yyval.tiexpr)->setRanges(ti);
+        }
       }
     break;
 
   case 96: /* ti_expr: ti_expr "++" base_ti_expr  */
       {
         (yyval.tiexpr) = (yyvsp[-2].tiexpr);
-        Type tt = Expression::type((yyval.tiexpr));
-        tt.dim(0);
-        TypeInst* lhs = new TypeInst((yyloc), tt, (yyvsp[-2].tiexpr)->domain());
-        BinOp* bop = new BinOp((yyloc), lhs, BOT_PLUSPLUS, (yyvsp[0].tiexpr));
-        bop->type(tt);
-        (yyval.tiexpr)->domain(bop);
+        if ((yyval.tiexpr) != nullptr) {
+          Type tt = Expression::type((yyval.tiexpr));
+          tt.dim(0);
+          TypeInst* lhs = new TypeInst((yyloc), tt, (yyvsp[-2].tiexpr)->domain());
+          BinOp* bop = new BinOp((yyloc), lhs, BOT_PLUSPLUS, (yyvsp[0].tiexpr));
+          bop->type(tt);
+          (yyval.tiexpr)->domain(bop);
+        }
       }
     break;
 
   case 97: /* base_ti_expr: base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
       }
     break;
 
   case 98: /* base_ti_expr: "opt" base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.ot(Type::OT_OPTIONAL);
           tt.otExplicit(true);
           (yyval.tiexpr)->type(tt);
         }
       }
     break;
 
   case 99: /* base_ti_expr: "par" opt_opt base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.tiExplicit(true);
           if ((yyvsp[-1].bValue)) {
             tt.ot(Type::OT_OPTIONAL);
             tt.otExplicit(true);
@@ -4590,12 +4592,12 @@ yyreduce:
       }
     break;
 
   case 100: /* base_ti_expr: "var" opt_opt base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        Type tt = Expression::type((yyval.tiexpr));
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
+          Type tt = Expression::type((yyval.tiexpr));
           tt.ti(Type::TI_VAR);
           tt.tiExplicit(true);
           if ((yyvsp[-1].bValue)) {
             tt.ot(Type::OT_OPTIONAL);
             tt.otExplicit(true);
@@ -4605,21 +4607,21 @@ yyreduce:
       }
     break;
 
   case 101: /* base_ti_expr: "set" "of" base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.st(Type::ST_SET);
           (yyval.tiexpr)->type(tt);
         }
       }
     break;
 
   case 102: /* base_ti_expr: "opt" "set" "of" base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.st(Type::ST_SET);
           tt.ot(Type::OT_OPTIONAL);
           tt.otExplicit(true);
           (yyval.tiexpr)->type(tt);
@@ -4627,11 +4629,11 @@ yyreduce:
       }
     break;
 
   case 103: /* base_ti_expr: "par" opt_opt "set" "of" base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.tiExplicit(true);
           tt.st(Type::ST_SET);
           if ((yyvsp[-3].bValue)) {
             tt.ot(Type::OT_OPTIONAL);
@@ -4642,11 +4644,11 @@ yyreduce:
       }
     break;
 
   case 104: /* base_ti_expr: "var" opt_opt "set" "of" base_ti_expr_tail  */
       { (yyval.tiexpr) = (yyvsp[0].tiexpr);
-        if ((yyval.tiexpr)) {
+        if ((yyval.tiexpr) != nullptr) {
           Type tt = Expression::type((yyval.tiexpr));
           tt.ti(Type::TI_VAR);
           tt.tiExplicit(true);
           tt.st(Type::ST_SET);
           if ((yyvsp[-3].bValue)) {
@@ -6702,11 +6704,11 @@ yyerrlab:
                 yysyntax_error_status = YYENOMEM;
               }
           }
         yyerror (&yylloc, parm, yymsgp);
         if (yysyntax_error_status == YYENOMEM)
-          goto yyexhaustedlab;
+          YYNOMEM;
       }
     }
 
   yyerror_range[1] = yylloc;
   if (yyerrstatus == 3)
@@ -6739,10 +6741,11 @@ yyerrlab:
 yyerrorlab:
   /* Pacify compilers when the user code never invokes YYERROR and the
      label yyerrorlab therefore never appears in user code.  */
   if (0)
     YYERROR;
+  ++yynerrs;
 
   /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
   yylen = 0;
@@ -6802,36 +6805,34 @@ yyerrlab1:
 /*-------------------------------------.
 | yyacceptlab -- YYACCEPT comes here.  |
 `-------------------------------------*/
 yyacceptlab:
   yyresult = 0;
-  goto yyreturn;
+  goto yyreturnlab;
 
 
 /*-----------------------------------.
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
 yyabortlab:
   yyresult = 1;
-  goto yyreturn;
+  goto yyreturnlab;
 
 
-#if 1
-/*-------------------------------------------------.
-| yyexhaustedlab -- memory exhaustion comes here.  |
-`-------------------------------------------------*/
+/*-----------------------------------------------------------.
+| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
+`-----------------------------------------------------------*/
 yyexhaustedlab:
   yyerror (&yylloc, parm, YY_("memory exhausted"));
   yyresult = 2;
-  goto yyreturn;
-#endif
+  goto yyreturnlab;
 
 
-/*-------------------------------------------------------.
-| yyreturn -- parsing is finished, clean up and return.  |
-`-------------------------------------------------------*/
-yyreturn:
+/*----------------------------------------------------------.
+| yyreturnlab -- parsing is finished, clean up and return.  |
+`----------------------------------------------------------*/
+yyreturnlab:
   if (yychar != YYEMPTY)
     {
       /* Make sure we have latest lookahead translation.  See comments at
          user semantic actions for why this is necessary.  */
       yytoken = YYTRANSLATE (yychar);
diff --git a/lib/parser.yxx b/lib/parser.yxx
index 2884883e..ceb392a7 100644
--- a/lib/parser.yxx
+++ b/lib/parser.yxx
@@ -861,47 +861,53 @@ ti_expr_list_head :
 ti_expr :
       base_ti_expr
     | MZN_ARRAY MZN_LEFT_BRACKET ti_expr_list MZN_RIGHT_BRACKET MZN_OF base_ti_expr
       {
         $$ = $6;
-        if ($$ && $3) $$->setRanges(*$3);
+        if ($$ != nullptr && $3 != nullptr) {
+          $$->setRanges(*$3);
+        }
         delete $3;
       }
     | MZN_LIST MZN_OF base_ti_expr
       {
         $$ = $3;
         std::vector<TypeInst*> ti(1);
         ti[0] = new TypeInst(@$,Type::parint());
-        if ($$) $$->setRanges(ti);
+        if ($$ != nullptr){
+          $$->setRanges(ti);
+        }
       }
     | ti_expr MZN_PLUSPLUS base_ti_expr
       {
         $$ = $1;
-        Type tt = Expression::type($$);
-        tt.dim(0);
-        TypeInst* lhs = new TypeInst(@$, tt, $1->domain());
-        BinOp* bop = new BinOp(@$, lhs, BOT_PLUSPLUS, $3);
-        bop->type(tt);
-        $$->domain(bop);
+        if ($$ != nullptr) {
+          Type tt = Expression::type($$);
+          tt.dim(0);
+          TypeInst* lhs = new TypeInst(@$, tt, $1->domain());
+          BinOp* bop = new BinOp(@$, lhs, BOT_PLUSPLUS, $3);
+          bop->type(tt);
+          $$->domain(bop);
+        }
       }
 
 base_ti_expr :
       base_ti_expr_tail
       { $$ = $1;
       }
     | MZN_OPT base_ti_expr_tail
       { $$ = $2;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.ot(Type::OT_OPTIONAL);
           tt.otExplicit(true);
           $$->type(tt);
         }
       }
     | MZN_PAR opt_opt base_ti_expr_tail
       { $$ = $3;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.tiExplicit(true);
           if ($2) {
             tt.ot(Type::OT_OPTIONAL);
             tt.otExplicit(true);
@@ -909,12 +915,12 @@ base_ti_expr :
           $$->type(tt);
         }
       }
     | MZN_VAR opt_opt base_ti_expr_tail
       { $$ = $3;
-        Type tt = Expression::type($$);
-        if ($$) {
+        if ($$ != nullptr) {
+          Type tt = Expression::type($$);
           tt.ti(Type::TI_VAR);
           tt.tiExplicit(true);
           if ($2) {
             tt.ot(Type::OT_OPTIONAL);
             tt.otExplicit(true);
@@ -922,29 +928,29 @@ base_ti_expr :
           $$->type(tt);
         }
       }
     | MZN_SET MZN_OF base_ti_expr_tail
       { $$ = $3;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.st(Type::ST_SET);
           $$->type(tt);
         }
       }
     | MZN_OPT MZN_SET MZN_OF base_ti_expr_tail
       { $$ = $4;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.st(Type::ST_SET);
           tt.ot(Type::OT_OPTIONAL);
           tt.otExplicit(true);
           $$->type(tt);
         }
       }
     | MZN_PAR opt_opt MZN_SET MZN_OF base_ti_expr_tail
       { $$ = $5;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.tiExplicit(true);
           tt.st(Type::ST_SET);
           if ($2) {
             tt.ot(Type::OT_OPTIONAL);
@@ -953,11 +959,11 @@ base_ti_expr :
           $$->type(tt);
         }
       }
     | MZN_VAR opt_opt MZN_SET MZN_OF base_ti_expr_tail
       { $$ = $5;
-        if ($$) {
+        if ($$ != nullptr) {
           Type tt = Expression::type($$);
           tt.ti(Type::TI_VAR);
           tt.tiExplicit(true);
           tt.st(Type::ST_SET);
           if ($2) {
diff --git a/tests/spec/unit/regression/github_730.mzn b/tests/spec/unit/regression/github_730.mzn
new file mode 100644
index 00000000..e03355a5
--- /dev/null
+++ b/tests/spec/unit/regression/github_730.mzn
@@ -0,0 +1,32 @@
+/***
+!Test
+solvers: [gecode]
+expected:
+- !Error
+  type: SyntaxError
+type: compile
+***/
+
+/** @group stdlib.output Create string to visualise a 2D boolean array \a !9Mã™a checkered board. */
+function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
+function string: show_array2d_bool(array[int,int] of bool: x) =
+	if length(x) != 0 then
+		let {
+			int: one_digits!9Mã™a checkered board. */
+function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
+function string: show_array2d_bool(array[intt(q in 1..one_digits)(" ") ++ " "
+			++ concat(j in index_set_2of2(x))(
+				let {
+					int: digit = (j div pow(10, two_digits - i)) mod 10;
+				} in if digit != 0 \/ j > pow(10, two_digits - i) then show (digit) else " " endif
+			)
+			++ "\n"
+		) ++
+		concat(i in index_set_1of2(x))(
+			concat(q in 1..(one_digits - (floor(log10(i)) + 1)))(" ")
+			++ "\(i) "
+			++ concat(j in index_set_2of2(x))(if x[i,j] then "‚ñà" else " " endif)
+			++ "\n"
+		)
+	endif;
+

Vulnerable code: set(parser_yxx_md5_cached "a1a3ad0d5717f0cc50417099ff2ae02f")
/* A Bison parser, made by GNU Bison 3.7.6.  */
#ifndef YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
# define YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
#endif /* !YY_MZN_YY_USERS_GUIDOT_PROGRAMMING_MINIZINC_LIBMZN_BUILD_XCODE_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED  */
/* A Bison parser, made by GNU Bison 3.7.6.  */
#define YYBISON 30706
#define YYBISON_VERSION "3.7.6"
#if defined __GNUC__ && ! defined __ICC && 407 <= __GNUC__ * 100 + __GNUC_MINOR__
# define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                            \
  /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
     852,   856,   858,   862,   863,   869,   876,   888,   891,   900,
     912,   925,   933,   943,   956,   970,   974,   979,   980,   984,
     986,   988,   990,   992,   994,  1001,  1011,  1013,  1018,  1024,
    1027,  1029,  1033,  1035,  1037,  1039,  1041,  1044,  1047,  1049,
    1055,  1056,  1058,  1060,  1062,  1064,  1073,  1075,  1077,  1079,
    1081,  1083,  1085,  1087,  1089,  1091,  1093,  1095,  1097,  1099,
    1101,  1110,  1112,  1114,  1116,  1118,  1120,  1122,  1124,  1126,
    1128,  1130,  1132,  1134,  1139,  1144,  1149,  1154,  1159,  1164,
    1169,  1175,  1181,  1183,  1196,  1197,  1199,  1201,  1203,  1205,
    1207,  1209,  1211,  1213,  1215,  1217,  1219,  1221,  1223,  1225,
    1227,  1229,  1231,  1233,  1235,  1244,  1246,  1248,  1250,  1252,
    1254,  1256,  1258,  1260,  1262,  1264,  1266,  1268,  1270,  1272,
    1281,  1283,  1285,  1287,  1289,  1291,  1293,  1295,  1297,  1299,
    1301,  1303,  1305,  1307,  1312,  1317,  1322,  1327,  1332,  1337,
    1342,  1347,  1353,  1355,  1362,  1374,  1376,  1380,  1382,  1384,
    1386,  1388,  1390,  1393,  1395,  1398,  1400,  1403,  1405,  1408,
    1410,  1412,  1414,  1416,  1418,  1420,  1422,  1424,  1426,  1428,
    1429,  1432,  1434,  1437,  1438,  1441,  1443,  1446,  1447,  1450,
    1452,  1455,  1456,  1459,  1461,  1464,  1465,  1468,  1470,  1473,
    1474,  1477,  1479,  1482,  1483,  1484,  1487,  1488,  1491,  1492,
    1495,  1497,  1500,  1501,  1504,  1506,  1511,  1513,  1519,  1524,
    1532,  1541,  1547,  1556,  1565,  1567,  1572,  1577,  1591,  1599,
    1601,  1605,  1612,  1618,  1621,  1624,  1626,  1628,  1634,  1636,
    1638,  1646,  1648,  1651,  1654,  1657,  1659,  1661,  1663,  1667,
    1669,  1716,  1718,  1779,  1819,  1822,  1827,  1834,  1839,  1842,
    1845,  1855,  1867,  1878,  1881,  1885,  1896,  1907,  1926,  1933,
    1937,  1940,  1944,  1955,  1975,  1982,  1998,  1999,  2003,  2005,
    2007,  2009,  2011,  2013,  2015,  2017,  2019,  2021,  2023,  2025,
    2027,  2029,  2031,  2033,  2035,  2037,  2039,  2041,  2043,  2045,
    2047,  2049,  2051,  2053,  2055,  2057,  2061,  2069,  2101,  2103,
    2105,  2106,  2126,  2180,  2200,  2255,  2258,  2264,  2270,  2272,
    2276,  2278,  2285,  2294,  2296,  2304,  2306,  2315,  2315,  2318,
    2326,  2337,  2338,  2341,  2343,  2345,  2349,  2353,  2357,  2359,
    2361,  2363,  2365,  2367,  2369,  2371,  2373,  2375,  2377,  2379,
    2381,  2383,  2385,  2387,  2389,  2391,  2393,  2395,  2397,  2399,
    2401,  2403,  2405,  2407,  2409,  2411,  2413,  2415,  2417,  2419,
    2421,  2423
#ifdef YYPRINT
/* YYTOKNUM[NUM] -- (External) token number corresponding to the
   (internal) symbol number NUM (which must be that of a token).  */
static const yytype_int16 yytoknum[] =
{
       0,   256,   257,   258,   259,   260,   261,   262,   263,   264,
     265,   266,   267,   268,   269,   270,   271,   272,   273,   274,
     275,   276,   277,   278,   279,   280,   281,   282,   283,   284,
     285,   286,   287,   288,   289,   290,   291,   292,   293,   294,
     295,   296,   297,   298,   299,   300,   301,   302,   303,   304,
     305,   306,   307,   308,   309,   310,   311,   312,   313,   314,
     315,   316,   317,   318,   319,   320,   321,   322,   323,   324,
     325,   326,   327,   328,   329,   330,   331,   332,   333,   334,
     335,   336,   337,   338,   339,   340,   341,   342,   343,   344,
     345,   346,   347,   348,   349,   350,   351,   352,   353,   354,
     355,   356,   357,   358,   359,   360,   361,   362,   363,   364,
     365,   366,   367,   368,   369,   370,   371,   372,   373,   374,
     375,   376,   377,   378,   379,   380,   381,   382,   383,   384,
     385,   386,   387,   388,   389,   390,   391,   392,   393,   394,
     395,   396,   397,   398,    59,   123,   125,    40,    41,    44,
      58,   124
};
#endif

  /* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
     STATE-NUM.  */
  /* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
     Performed when YYTABLE does not specify something else to do.  Zero
     means the default is an error.  */
  /* YYPGOTO[NTERM-NUM].  */
  /* YYDEFGOTO[NTERM-NUM].  */
  /* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
     positive, shift that token.  If negative, reduce the rule whose
     number is the opposite.  If YYTABLE_NINF, syntax error.  */
  /* YYSTOS[STATE-NUM] -- The (internal number of the) accessing
     symbol of state STATE-NUM.  */
  /* YYR1[YYN] -- Symbol number of symbol that rule YYN derives.  */
  /* YYR2[YYN] -- Number of symbols on the right hand side of rule YYN.  */
/* YY_LOCATION_PRINT -- Print the location on the stream.
# ifndef YY_LOCATION_PRINT
#  if defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
 }
#   define YY_LOCATION_PRINT(File, Loc)          \
  yy_location_print_ (File, &(Loc))
#   define YY_LOCATION_PRINT(File, Loc) ((void) 0)
# endif /* !defined YY_LOCATION_PRINT */
# ifdef YYPRINT
  if (yykind < YYNTOKENS)
    YYPRINT (yyo, yytoknum[yykind], *yyvaluep);
# endif
  YY_LOCATION_PRINT (yyo, *yylocationp);
    goto yyexhaustedlab;
        goto yyexhaustedlab;
          goto yyexhaustedlab;
        if ((yyval.tiexpr) && (yyvsp[-3].tiexprs)) (yyval.tiexpr)->setRanges(*(yyvsp[-3].tiexprs));
        if ((yyval.tiexpr)) (yyval.tiexpr)->setRanges(ti);
        Type tt = Expression::type((yyval.tiexpr));
        tt.dim(0);
        TypeInst* lhs = new TypeInst((yyloc), tt, (yyvsp[-2].tiexpr)->domain());
        BinOp* bop = new BinOp((yyloc), lhs, BOT_PLUSPLUS, (yyvsp[0].tiexpr));
        bop->type(tt);
        (yyval.tiexpr)->domain(bop);
        if ((yyval.tiexpr)) {
        if ((yyval.tiexpr)) {
        Type tt = Expression::type((yyval.tiexpr));
        if ((yyval.tiexpr)) {
        if ((yyval.tiexpr)) {
        if ((yyval.tiexpr)) {
        if ((yyval.tiexpr)) {
        if ((yyval.tiexpr)) {
          goto yyexhaustedlab;
  goto yyreturn;
  goto yyreturn;
#if 1
/*-------------------------------------------------.
| yyexhaustedlab -- memory exhaustion comes here.  |
`-------------------------------------------------*/
  goto yyreturn;
#endif
/*-------------------------------------------------------.
| yyreturn -- parsing is finished, clean up and return.  |
`-------------------------------------------------------*/
yyreturn:
        if ($$ && $3) $$->setRanges(*$3);
        if ($$) $$->setRanges(ti);
        Type tt = Expression::type($$);
        tt.dim(0);
        TypeInst* lhs = new TypeInst(@$, tt, $1->domain());
        BinOp* bop = new BinOp(@$, lhs, BOT_PLUSPLUS, $3);
        bop->type(tt);
        $$->domain(bop);
        if ($$) {
        if ($$) {
        Type tt = Expression::type($$);
        if ($$) {
        if ($$) {
        if ($$) {
        if ($$) {
        if ($$) {
Fixed code: -  Fix a problem in the parser where a nullptr would be used before a syntax
   error was thrown (:bugref:`730`).
set(parser_yxx_md5_cached "a49d72232e30c06667be4eb862bc67eb")
/* A Bison parser, made by GNU Bison 3.8.2.  */
#ifndef YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED
# define YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED


#endif /* !YY_MZN_YY_USERS_DEKKER1_LIBRARY_MOBILE_DOCUMENTS_COM_APPLE_CLOUDDOCS_CODE_GITHUB_COM_MINIZINC_LIBMINIZINC_BUILD_NOSYNC_INCLUDE_MINIZINC_PARSER_TAB_HH_INCLUDED  */
/* A Bison parser, made by GNU Bison 3.8.2.  */
#define YYBISON 30802
#define YYBISON_VERSION "3.8.2"
#if defined __GNUC__ && ! defined __ICC && 406 <= __GNUC__ * 100 + __GNUC_MINOR__
# if __GNUC__ * 100 + __GNUC_MINOR__ < 407
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
    _Pragma ("GCC diagnostic push")                                     \
    _Pragma ("GCC diagnostic ignored \"-Wuninitialized\"")
# else
#  define YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN                           \
# endif
/* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
     852,   856,   858,   862,   863,   871,   880,   894,   897,   906,
     918,   931,   939,   949,   962,   976,   980,   985,   986,   990,
     992,   994,   996,   998,  1000,  1007,  1017,  1019,  1024,  1030,
    1033,  1035,  1039,  1041,  1043,  1045,  1047,  1050,  1053,  1055,
    1061,  1062,  1064,  1066,  1068,  1070,  1079,  1081,  1083,  1085,
    1087,  1089,  1091,  1093,  1095,  1097,  1099,  1101,  1103,  1105,
    1107,  1116,  1118,  1120,  1122,  1124,  1126,  1128,  1130,  1132,
    1134,  1136,  1138,  1140,  1145,  1150,  1155,  1160,  1165,  1170,
    1175,  1181,  1187,  1189,  1202,  1203,  1205,  1207,  1209,  1211,
    1213,  1215,  1217,  1219,  1221,  1223,  1225,  1227,  1229,  1231,
    1233,  1235,  1237,  1239,  1241,  1250,  1252,  1254,  1256,  1258,
    1260,  1262,  1264,  1266,  1268,  1270,  1272,  1274,  1276,  1278,
    1287,  1289,  1291,  1293,  1295,  1297,  1299,  1301,  1303,  1305,
    1307,  1309,  1311,  1313,  1318,  1323,  1328,  1333,  1338,  1343,
    1348,  1353,  1359,  1361,  1368,  1380,  1382,  1386,  1388,  1390,
    1392,  1394,  1396,  1399,  1401,  1404,  1406,  1409,  1411,  1414,
    1416,  1418,  1420,  1422,  1424,  1426,  1428,  1430,  1432,  1434,
    1435,  1438,  1440,  1443,  1444,  1447,  1449,  1452,  1453,  1456,
    1458,  1461,  1462,  1465,  1467,  1470,  1471,  1474,  1476,  1479,
    1480,  1483,  1485,  1488,  1489,  1490,  1493,  1494,  1497,  1498,
    1501,  1503,  1506,  1507,  1510,  1512,  1517,  1519,  1525,  1530,
    1538,  1547,  1553,  1562,  1571,  1573,  1578,  1583,  1597,  1605,
    1607,  1611,  1618,  1624,  1627,  1630,  1632,  1634,  1640,  1642,
    1644,  1652,  1654,  1657,  1660,  1663,  1665,  1667,  1669,  1673,
    1675,  1722,  1724,  1785,  1825,  1828,  1833,  1840,  1845,  1848,
    1851,  1861,  1873,  1884,  1887,  1891,  1902,  1913,  1932,  1939,
    1943,  1946,  1950,  1961,  1981,  1988,  2004,  2005,  2009,  2011,
    2013,  2015,  2017,  2019,  2021,  2023,  2025,  2027,  2029,  2031,
    2033,  2035,  2037,  2039,  2041,  2043,  2045,  2047,  2049,  2051,
    2053,  2055,  2057,  2059,  2061,  2063,  2067,  2075,  2107,  2109,
    2111,  2112,  2132,  2186,  2206,  2261,  2264,  2270,  2276,  2278,
    2282,  2284,  2291,  2300,  2302,  2310,  2312,  2321,  2321,  2324,
    2332,  2343,  2344,  2347,  2349,  2351,  2355,  2359,  2363,  2365,
    2367,  2369,  2371,  2373,  2375,  2377,  2379,  2381,  2383,  2385,
    2387,  2389,  2391,  2393,  2395,  2397,  2399,  2401,  2403,  2405,
    2407,  2409,  2411,  2413,  2415,  2417,  2419,  2421,  2423,  2425,
    2427,  2429
/* YYPACT[STATE-NUM] -- Index in YYTABLE of the portion describing
   STATE-NUM.  */
/* YYDEFACT[STATE-NUM] -- Default reduction number in state STATE-NUM.
   Performed when YYTABLE does not specify something else to do.  Zero
   means the default is an error.  */
/* YYPGOTO[NTERM-NUM].  */
/* YYDEFGOTO[NTERM-NUM].  */
/* YYTABLE[YYPACT[STATE-NUM]] -- What to do in state STATE-NUM.  If
   positive, shift that token.  If negative, reduce the rule whose
   number is the opposite.  If YYTABLE_NINF, syntax error.  */
/* YYSTOS[STATE-NUM] -- The symbol kind of the accessing symbol of
   state STATE-NUM.  */
/* YYR1[RULE-NUM] -- Symbol kind of the left-hand side of rule RULE-NUM.  */
/* YYR2[RULE-NUM] -- Number of symbols on the right-hand side of rule RULE-NUM.  */
#define YYNOMEM         goto yyexhaustedlab
/* YYLOCATION_PRINT -- Print the location on the stream.
# ifndef YYLOCATION_PRINT

#  if defined YY_LOCATION_PRINT

   /* Temporary convenience wrapper in case some people defined the
      undocumented and private YY_LOCATION_PRINT macros.  */
#   define YYLOCATION_PRINT(File, Loc)  YY_LOCATION_PRINT(File, *(Loc))

#  elif defined YYLTYPE_IS_TRIVIAL && YYLTYPE_IS_TRIVIAL
}

#   define YYLOCATION_PRINT  yy_location_print_
    /* Temporary convenience wrapper in case some people defined the
       undocumented and private YY_LOCATION_PRINT macros.  */
#   define YY_LOCATION_PRINT(File, Loc)  YYLOCATION_PRINT(File, &(Loc))

#   define YYLOCATION_PRINT(File, Loc) ((void) 0)
    /* Temporary convenience wrapper in case some people defined the
       undocumented and private YY_LOCATION_PRINT macros.  */
#   define YY_LOCATION_PRINT  YYLOCATION_PRINT

# endif /* !defined YYLOCATION_PRINT */
  YYLOCATION_PRINT (yyo, yylocationp);

    YYNOMEM;
        YYNOMEM;
          YYNOMEM;

        if ((yyval.tiexpr) != nullptr && (yyvsp[-3].tiexprs) != nullptr) {
          (yyval.tiexpr)->setRanges(*(yyvsp[-3].tiexprs));
        }
        if ((yyval.tiexpr) != nullptr){
          (yyval.tiexpr)->setRanges(ti);
        }
        if ((yyval.tiexpr) != nullptr) {
          Type tt = Expression::type((yyval.tiexpr));
          tt.dim(0);
          TypeInst* lhs = new TypeInst((yyloc), tt, (yyvsp[-2].tiexpr)->domain());
          BinOp* bop = new BinOp((yyloc), lhs, BOT_PLUSPLUS, (yyvsp[0].tiexpr));
          bop->type(tt);
          (yyval.tiexpr)->domain(bop);
        }
        if ((yyval.tiexpr) != nullptr) {
        if ((yyval.tiexpr) != nullptr) {
        if ((yyval.tiexpr) != nullptr) {
          Type tt = Expression::type((yyval.tiexpr));
        if ((yyval.tiexpr) != nullptr) {
        if ((yyval.tiexpr) != nullptr) {
        if ((yyval.tiexpr) != nullptr) {
        if ((yyval.tiexpr) != nullptr) {
          YYNOMEM;
  ++yynerrs;
  goto yyreturnlab;
  goto yyreturnlab;
/*-----------------------------------------------------------.
| yyexhaustedlab -- YYNOMEM (memory exhaustion) comes here.  |
`-----------------------------------------------------------*/
  goto yyreturnlab;
/*----------------------------------------------------------.
| yyreturnlab -- parsing is finished, clean up and return.  |
`----------------------------------------------------------*/
yyreturnlab:
        if ($$ != nullptr && $3 != nullptr) {
          $$->setRanges(*$3);
        }
        if ($$ != nullptr){
          $$->setRanges(ti);
        }
        if ($$ != nullptr) {
          Type tt = Expression::type($$);
          tt.dim(0);
          TypeInst* lhs = new TypeInst(@$, tt, $1->domain());
          BinOp* bop = new BinOp(@$, lhs, BOT_PLUSPLUS, $3);
          bop->type(tt);
          $$->domain(bop);
        }
        if ($$ != nullptr) {
        if ($$ != nullptr) {
        if ($$ != nullptr) {
          Type tt = Expression::type($$);
        if ($$ != nullptr) {
        if ($$ != nullptr) {
        if ($$ != nullptr) {
        if ($$ != nullptr) {
/***
!Test
solvers: [gecode]
expected:
- !Error
  type: SyntaxError
type: compile
***/

/** @group stdlib.output Create string to visualise a 2D boolean array \a !9Mã™a checkered board. */
function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
function string: show_array2d_bool(array[int,int] of bool: x) =
	if length(x) != 0 then
		let {
			int: one_digits!9Mã™a checkered board. */
function string: show_array2d_bool(array[int,int] of var bool: x) ::output_only;
function string: show_array2d_bool(array[intt(q in 1..one_digits)(" ") ++ " "
			++ concat(j in index_set_2of2(x))(
				let {
					int: digit = (j div pow(10, two_digits - i)) mod 10;
				} in if digit != 0 \/ j > pow(10, two_digits - i) then show (digit) else " " endif
			)
			++ "\n"
		) ++
		concat(i in index_set_1of2(x))(
			concat(q in 1..(one_digits - (floor(log10(i)) + 1)))(" ")
			++ "\(i) "
			++ concat(j in index_set_2of2(x))(if x[i,j] then "‚ñà" else " " endif)
			++ "\n"
		)
	endif;