[postgis-tickets] r17901 - Fix leak in WKT collection parser

Raul raul at rmr.ninja
Thu Oct 10 06:01:34 PDT 2019


Author: algunenano
Date: 2019-10-10 06:01:34 -0700 (Thu, 10 Oct 2019)
New Revision: 17901

Modified:
   branches/2.5/NEWS
   branches/2.5/liblwgeom/lwin_wkt_parse.c
   branches/2.5/liblwgeom/lwin_wkt_parse.h
   branches/2.5/liblwgeom/lwin_wkt_parse.y
Log:
Fix leak in WKT collection parser

References #4537


Modified: branches/2.5/NEWS
===================================================================
--- branches/2.5/NEWS	2019-10-10 13:01:09 UTC (rev 17900)
+++ branches/2.5/NEWS	2019-10-10 13:01:34 UTC (rev 17901)
@@ -17,6 +17,7 @@
   - #4517, Documentation error ST_EndPoint (Samuel Spurling)
   - #4534, Fix leak in lwcurvepoly_from_wkb_state (Raúl Marín)
   - #4536, Fix leak in lwcollection_from_wkb_state (Raúl Marín)
+  - #4537, Fix leak in WKT collection parser (Raúl Marín)
 
 
 PostGIS 2.5.3

Modified: branches/2.5/liblwgeom/lwin_wkt_parse.c
===================================================================
--- branches/2.5/liblwgeom/lwin_wkt_parse.c	2019-10-10 13:01:09 UTC (rev 17900)
+++ branches/2.5/liblwgeom/lwin_wkt_parse.c	2019-10-10 13:01:34 UTC (rev 17901)
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.2.2.  */
+/* A Bison parser, made by GNU Bison 3.4.  */
 
 /* Bison implementation for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -47,7 +48,7 @@
 #define YYBISON 1
 
 /* Bison version.  */
-#define YYBISON_VERSION "3.2.2"
+#define YYBISON_VERSION "3.4"
 
 /* Skeleton name.  */
 #define YYSKELETON_NAME "yacc.c"
@@ -74,7 +75,7 @@
 #define yylloc          wkt_yylloc
 
 /* First part of user prologue.  */
-#line 1 "lwin_wkt_parse.y" /* yacc.c:338  */
+#line 1 "lwin_wkt_parse.y"
 
 
 /* WKT Parser */
@@ -155,10 +156,7 @@
 			global_parser_result.message = parser_error_messages[PARSER_ERROR_OTHER];
 			global_parser_result.errlocation = wkt_yylloc.last_column;
 		}
-		/* Got a completed object parsed, but errored out after... */
-		/* Due to junk after the valid WKT, eg: "POINT(1 1) foobar" */
-		/* https://trac.osgeo.org/postgis/ticket/4273 */
-		if ( global_parser_result.errcode && ! parse_rv )
+		else if (global_parser_result.geom)
 		{
 			lwgeom_free(global_parser_result.geom);
 			global_parser_result.geom = NULL;
@@ -185,7 +183,8 @@
 
 
 
-#line 189 "lwin_wkt_parse.c" /* yacc.c:338  */
+#line 187 "lwin_wkt_parse.c"
+
 # ifndef YY_NULLPTR
 #  if defined __cplusplus
 #   if 201103L <= __cplusplus
@@ -206,8 +205,8 @@
 # define YYERROR_VERBOSE 1
 #endif
 
-/* In a future release of Bison, this section will be replaced
-   by #include "lwin_wkt_parse.h".  */
+/* Use api.header.include to #include this header
+   instead of duplicating it here.  */
 #ifndef YY_WKT_YY_LWIN_WKT_PARSE_H_INCLUDED
 # define YY_WKT_YY_LWIN_WKT_PARSE_H_INCLUDED
 /* Debug traces.  */
@@ -275,10 +274,9 @@
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 115 "lwin_wkt_parse.y" /* yacc.c:353  */
+#line 112 "lwin_wkt_parse.y"
 
 	int integervalue;
 	double doublevalue;
@@ -287,9 +285,9 @@
 	POINT coordinatevalue;
 	POINTARRAY *ptarrayvalue;
 
-#line 291 "lwin_wkt_parse.c" /* yacc.c:353  */
+#line 289 "lwin_wkt_parse.c"
+
 };
-
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1
@@ -418,6 +416,8 @@
 #endif
 
 
+#define YY_ASSERT(E) ((void) (0 && (E)))
+
 #if ! defined yyoverflow || YYERROR_VERBOSE
 
 /* The parser invokes alloca or malloc; define the necessary symbols.  */
@@ -562,16 +562,16 @@
 /* YYNSTATES -- Number of states.  */
 #define YYNSTATES  264
 
-/* YYTRANSLATE[YYX] -- Symbol number corresponding to YYX as returned
-   by yylex, with out-of-bounds checking.  */
 #define YYUNDEFTOK  2
 #define YYMAXUTOK   280
 
+/* YYTRANSLATE(TOKEN-NUM) -- Symbol number corresponding to TOKEN-NUM
+   as returned by yylex, with out-of-bounds checking.  */
 #define YYTRANSLATE(YYX)                                                \
   ((unsigned) (YYX) <= YYMAXUTOK ? yytranslate[YYX] : YYUNDEFTOK)
 
 /* YYTRANSLATE[TOKEN-NUM] -- Symbol number corresponding to TOKEN-NUM
-   as returned by yylex, without out-of-bounds checking.  */
+   as returned by yylex.  */
 static const yytype_uint8 yytranslate[] =
 {
        0,     2,     2,     2,     2,     2,     2,     2,     2,     2,
@@ -609,20 +609,20 @@
   /* YYRLINE[YYN] -- Source line where rule number YYN was defined.  */
 static const yytype_uint16 yyrline[] =
 {
-       0,   219,   219,   221,   225,   226,   227,   228,   229,   230,
-     231,   232,   233,   234,   235,   236,   237,   238,   239,   242,
-     244,   246,   248,   252,   254,   258,   260,   262,   264,   268,
-     270,   272,   274,   276,   278,   282,   284,   286,   288,   292,
-     294,   296,   298,   302,   304,   306,   308,   312,   314,   318,
-     320,   324,   326,   328,   330,   334,   336,   340,   343,   345,
-     347,   349,   353,   355,   359,   360,   361,   362,   365,   367,
-     371,   373,   377,   380,   383,   385,   387,   389,   393,   395,
-     397,   399,   401,   403,   407,   409,   411,   413,   417,   419,
-     421,   423,   425,   427,   429,   431,   435,   437,   439,   441,
-     445,   447,   451,   453,   455,   457,   461,   463,   465,   467,
-     471,   473,   477,   479,   483,   485,   487,   489,   493,   497,
-     499,   501,   503,   507,   509,   513,   515,   517,   521,   523,
-     525,   527,   531,   533,   537,   539,   541
+       0,   216,   216,   218,   222,   223,   224,   225,   226,   227,
+     228,   229,   230,   231,   232,   233,   234,   235,   236,   239,
+     241,   243,   245,   249,   251,   255,   257,   259,   261,   265,
+     267,   269,   271,   273,   275,   279,   281,   283,   285,   289,
+     291,   293,   295,   299,   301,   303,   305,   309,   311,   315,
+     317,   321,   323,   325,   327,   331,   333,   337,   340,   342,
+     344,   346,   350,   352,   356,   357,   358,   359,   362,   364,
+     368,   370,   374,   377,   380,   382,   384,   386,   390,   392,
+     394,   396,   398,   400,   404,   406,   408,   410,   414,   416,
+     418,   420,   422,   424,   426,   428,   432,   434,   436,   438,
+     442,   444,   448,   450,   452,   454,   458,   460,   462,   464,
+     468,   470,   474,   476,   480,   482,   484,   486,   490,   494,
+     496,   498,   500,   504,   506,   510,   512,   514,   518,   520,
+     522,   524,   528,   530,   534,   536,   538
 };
 #endif
 
@@ -911,22 +911,22 @@
 
 #define YYRECOVERING()  (!!yyerrstatus)
 
-#define YYBACKUP(Token, Value)                                  \
-do                                                              \
-  if (yychar == YYEMPTY)                                        \
-    {                                                           \
-      yychar = (Token);                                         \
-      yylval = (Value);                                         \
-      YYPOPSTACK (yylen);                                       \
-      yystate = *yyssp;                                         \
-      goto yybackup;                                            \
-    }                                                           \
-  else                                                          \
-    {                                                           \
-      yyerror (YY_("syntax error: cannot back up")); \
-      YYERROR;                                                  \
-    }                                                           \
-while (0)
+#define YYBACKUP(Token, Value)                                    \
+  do                                                              \
+    if (yychar == YYEMPTY)                                        \
+      {                                                           \
+        yychar = (Token);                                         \
+        yylval = (Value);                                         \
+        YYPOPSTACK (yylen);                                       \
+        yystate = *yyssp;                                         \
+        goto yybackup;                                            \
+      }                                                           \
+    else                                                          \
+      {                                                           \
+        yyerror (YY_("syntax error: cannot back up")); \
+        YYERROR;                                                  \
+      }                                                           \
+  while (0)
 
 /* Error token number */
 #define YYTERROR        1
@@ -1109,7 +1109,7 @@
       YYFPRINTF (stderr, "   $%d = ", yyi + 1);
       yy_symbol_print (stderr,
                        yystos[yyssp[yyi + 1 - yynrhs]],
-                       &(yyvsp[(yyi + 1) - (yynrhs)])
+                       &yyvsp[(yyi + 1) - (yynrhs)]
                        , &(yylsp[(yyi + 1) - (yynrhs)])                       );
       YYFPRINTF (stderr, "\n");
     }
@@ -1213,7 +1213,10 @@
           case '\\':
             if (*++yyp != '\\')
               goto do_not_strip_quotes;
-            /* Fall through.  */
+            else
+              goto append;
+
+          append:
           default:
             if (yyres)
               yyres[yyn] = *yyp;
@@ -1309,10 +1312,10 @@
                 yyarg[yycount++] = yytname[yyx];
                 {
                   YYSIZE_T yysize1 = yysize + yytnamerr (YY_NULLPTR, yytname[yyx]);
-                  if (! (yysize <= yysize1
-                         && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+                  if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+                    yysize = yysize1;
+                  else
                     return 2;
-                  yysize = yysize1;
                 }
               }
         }
@@ -1336,9 +1339,10 @@
 
   {
     YYSIZE_T yysize1 = yysize + yystrlen (yyformat);
-    if (! (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM))
+    if (yysize <= yysize1 && yysize1 <= YYSTACK_ALLOC_MAXIMUM)
+      yysize = yysize1;
+    else
       return 2;
-    yysize = yysize1;
   }
 
   if (*yymsg_alloc < yysize)
@@ -1388,223 +1392,222 @@
   YY_IGNORE_MAYBE_UNINITIALIZED_BEGIN
   switch (yytype)
     {
-          case 28: /* geometry_no_srid  */
-#line 197 "lwin_wkt_parse.y" /* yacc.c:1254  */
+    case 28: /* geometry_no_srid  */
+#line 194 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1395 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1399 "lwin_wkt_parse.c"
         break;
 
     case 29: /* geometrycollection  */
-#line 198 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 195 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1401 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1405 "lwin_wkt_parse.c"
         break;
 
     case 31: /* multisurface  */
-#line 205 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 202 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1407 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1411 "lwin_wkt_parse.c"
         break;
 
     case 32: /* surface_list  */
-#line 184 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 181 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1413 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1417 "lwin_wkt_parse.c"
         break;
 
     case 33: /* tin  */
-#line 212 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 209 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1419 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1423 "lwin_wkt_parse.c"
         break;
 
     case 34: /* polyhedralsurface  */
-#line 211 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 208 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1425 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1429 "lwin_wkt_parse.c"
         break;
 
     case 35: /* multipolygon  */
-#line 204 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 201 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1431 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1435 "lwin_wkt_parse.c"
         break;
 
     case 36: /* polygon_list  */
-#line 185 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 182 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1437 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1441 "lwin_wkt_parse.c"
         break;
 
     case 37: /* patch_list  */
-#line 186 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 183 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1443 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1447 "lwin_wkt_parse.c"
         break;
 
     case 38: /* polygon  */
-#line 208 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 205 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1449 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1453 "lwin_wkt_parse.c"
         break;
 
     case 39: /* polygon_untagged  */
-#line 210 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 207 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1455 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1459 "lwin_wkt_parse.c"
         break;
 
     case 40: /* patch  */
-#line 209 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 206 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1461 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1465 "lwin_wkt_parse.c"
         break;
 
     case 41: /* curvepolygon  */
-#line 195 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 192 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1467 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1471 "lwin_wkt_parse.c"
         break;
 
     case 42: /* curvering_list  */
-#line 182 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 179 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1473 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1477 "lwin_wkt_parse.c"
         break;
 
     case 43: /* curvering  */
-#line 196 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 193 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1479 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1483 "lwin_wkt_parse.c"
         break;
 
     case 44: /* patchring_list  */
-#line 192 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 189 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1485 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1489 "lwin_wkt_parse.c"
         break;
 
     case 45: /* ring_list  */
-#line 191 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 188 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1491 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1495 "lwin_wkt_parse.c"
         break;
 
     case 46: /* patchring  */
-#line 181 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 178 "lwin_wkt_parse.y"
       { ptarray_free(((*yyvaluep).ptarrayvalue)); }
-#line 1497 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1501 "lwin_wkt_parse.c"
         break;
 
     case 47: /* ring  */
-#line 180 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 177 "lwin_wkt_parse.y"
       { ptarray_free(((*yyvaluep).ptarrayvalue)); }
-#line 1503 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1507 "lwin_wkt_parse.c"
         break;
 
     case 48: /* compoundcurve  */
-#line 194 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 191 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1509 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1513 "lwin_wkt_parse.c"
         break;
 
     case 49: /* compound_list  */
-#line 190 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 187 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1515 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1519 "lwin_wkt_parse.c"
         break;
 
     case 50: /* multicurve  */
-#line 201 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 198 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1521 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1525 "lwin_wkt_parse.c"
         break;
 
     case 51: /* curve_list  */
-#line 189 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 186 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1527 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1531 "lwin_wkt_parse.c"
         break;
 
     case 52: /* multilinestring  */
-#line 202 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 199 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1533 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1537 "lwin_wkt_parse.c"
         break;
 
     case 53: /* linestring_list  */
-#line 188 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 185 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1539 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1543 "lwin_wkt_parse.c"
         break;
 
     case 54: /* circularstring  */
-#line 193 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 190 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1545 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1549 "lwin_wkt_parse.c"
         break;
 
     case 55: /* linestring  */
-#line 199 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 196 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1551 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1555 "lwin_wkt_parse.c"
         break;
 
     case 56: /* linestring_untagged  */
-#line 200 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 197 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1557 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1561 "lwin_wkt_parse.c"
         break;
 
     case 57: /* triangle_list  */
-#line 183 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 180 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1563 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1567 "lwin_wkt_parse.c"
         break;
 
     case 58: /* triangle  */
-#line 213 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 210 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1569 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1573 "lwin_wkt_parse.c"
         break;
 
     case 59: /* triangle_untagged  */
-#line 214 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 211 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1575 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1579 "lwin_wkt_parse.c"
         break;
 
     case 60: /* multipoint  */
-#line 203 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 200 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1581 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1585 "lwin_wkt_parse.c"
         break;
 
     case 61: /* point_list  */
-#line 187 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 184 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1587 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1591 "lwin_wkt_parse.c"
         break;
 
     case 62: /* point_untagged  */
-#line 207 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 204 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1593 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1597 "lwin_wkt_parse.c"
         break;
 
     case 63: /* point  */
-#line 206 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 203 "lwin_wkt_parse.y"
       { lwgeom_free(((*yyvaluep).geometryvalue)); }
-#line 1599 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1603 "lwin_wkt_parse.c"
         break;
 
     case 64: /* ptarray  */
-#line 179 "lwin_wkt_parse.y" /* yacc.c:1254  */
+#line 176 "lwin_wkt_parse.y"
       { ptarray_free(((*yyvaluep).ptarrayvalue)); }
-#line 1605 "lwin_wkt_parse.c" /* yacc.c:1254  */
+#line 1609 "lwin_wkt_parse.c"
         break;
 
-
       default:
         break;
     }
@@ -1704,23 +1707,33 @@
   yylsp[0] = yylloc;
   goto yysetstate;
 
+
 /*------------------------------------------------------------.
-| yynewstate -- Push a new state, which is found in yystate.  |
+| yynewstate -- push a new state, which is found in yystate.  |
 `------------------------------------------------------------*/
- yynewstate:
+yynewstate:
   /* In all cases, when you get here, the value and location stacks
      have just been pushed.  So pushing a state here evens the stacks.  */
   yyssp++;
 
- yysetstate:
+
+/*--------------------------------------------------------------------.
+| yynewstate -- set current state (the top of the stack) to yystate.  |
+`--------------------------------------------------------------------*/
+yysetstate:
+  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
+  YY_ASSERT (0 <= yystate && yystate < YYNSTATES);
   *yyssp = (yytype_int16) yystate;
 
   if (yyss + yystacksize - 1 <= yyssp)
+#if !defined yyoverflow && !defined YYSTACK_RELOCATE
+    goto yyexhaustedlab;
+#else
     {
       /* Get the current used size of the three stacks, in elements.  */
       YYSIZE_T yysize = (YYSIZE_T) (yyssp - yyss + 1);
 
-#ifdef yyoverflow
+# if defined yyoverflow
       {
         /* Give user a chance to reallocate the stack.  Use copies of
            these so that the &'s don't force the real ones into
@@ -1742,10 +1755,7 @@
         yyvs = yyvs1;
         yyls = yyls1;
       }
-#else /* no yyoverflow */
-# ifndef YYSTACK_RELOCATE
-      goto yyexhaustedlab;
-# else
+# else /* defined YYSTACK_RELOCATE */
       /* Extend the stack our own way.  */
       if (YYMAXDEPTH <= yystacksize)
         goto yyexhaustedlab;
@@ -1762,12 +1772,11 @@
         YYSTACK_RELOCATE (yyss_alloc, yyss);
         YYSTACK_RELOCATE (yyvs_alloc, yyvs);
         YYSTACK_RELOCATE (yyls_alloc, yyls);
-#  undef YYSTACK_RELOCATE
+# undef YYSTACK_RELOCATE
         if (yyss1 != yyssa)
           YYSTACK_FREE (yyss1);
       }
 # endif
-#endif /* no yyoverflow */
 
       yyssp = yyss + yysize - 1;
       yyvsp = yyvs + yysize - 1;
@@ -1779,19 +1788,18 @@
       if (yyss + yystacksize - 1 <= yyssp)
         YYABORT;
     }
+#endif /* !defined yyoverflow && !defined YYSTACK_RELOCATE */
 
-  YYDPRINTF ((stderr, "Entering state %d\n", yystate));
-
   if (yystate == YYFINAL)
     YYACCEPT;
 
   goto yybackup;
 
+
 /*-----------.
 | yybackup.  |
 `-----------*/
 yybackup:
-
   /* Do appropriate processing given the current state.  Read a
      lookahead token if we need one and don't already have one.  */
 
@@ -1864,7 +1872,7 @@
 
 
 /*-----------------------------.
-| yyreduce -- Do a reduction.  |
+| yyreduce -- do a reduction.  |
 `-----------------------------*/
 yyreduce:
   /* yyn is the number of a rule to reduce with.  */
@@ -1886,818 +1894,819 @@
   YY_REDUCE_PRINT (yyn);
   switch (yyn)
     {
-        case 2:
-#line 220 "lwin_wkt_parse.y" /* yacc.c:1645  */
+  case 2:
+#line 217 "lwin_wkt_parse.y"
     { wkt_parser_geometry_new((yyvsp[0].geometryvalue), SRID_UNKNOWN); WKT_ERROR(); }
-#line 1893 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1901 "lwin_wkt_parse.c"
     break;
 
   case 3:
-#line 222 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 219 "lwin_wkt_parse.y"
     { wkt_parser_geometry_new((yyvsp[0].geometryvalue), (yyvsp[-2].integervalue)); WKT_ERROR(); }
-#line 1899 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1907 "lwin_wkt_parse.c"
     break;
 
   case 4:
-#line 225 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 222 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1905 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1913 "lwin_wkt_parse.c"
     break;
 
   case 5:
-#line 226 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 223 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1911 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1919 "lwin_wkt_parse.c"
     break;
 
   case 6:
-#line 227 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 224 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1917 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1925 "lwin_wkt_parse.c"
     break;
 
   case 7:
-#line 228 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 225 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1923 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1931 "lwin_wkt_parse.c"
     break;
 
   case 8:
-#line 229 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 226 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1929 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1937 "lwin_wkt_parse.c"
     break;
 
   case 9:
-#line 230 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 227 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1935 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1943 "lwin_wkt_parse.c"
     break;
 
   case 10:
-#line 231 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 228 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1941 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1949 "lwin_wkt_parse.c"
     break;
 
   case 11:
-#line 232 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 229 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1947 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1955 "lwin_wkt_parse.c"
     break;
 
   case 12:
-#line 233 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 230 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1953 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1961 "lwin_wkt_parse.c"
     break;
 
   case 13:
-#line 234 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 231 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1959 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1967 "lwin_wkt_parse.c"
     break;
 
   case 14:
-#line 235 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 232 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1965 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1973 "lwin_wkt_parse.c"
     break;
 
   case 15:
-#line 236 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 233 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1971 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1979 "lwin_wkt_parse.c"
     break;
 
   case 16:
-#line 237 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 234 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1977 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1985 "lwin_wkt_parse.c"
     break;
 
   case 17:
-#line 238 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 235 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1983 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1991 "lwin_wkt_parse.c"
     break;
 
   case 18:
-#line 239 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 236 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 1989 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 1997 "lwin_wkt_parse.c"
     break;
 
   case 19:
-#line 243 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 240 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 1995 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2003 "lwin_wkt_parse.c"
     break;
 
   case 20:
-#line 245 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 242 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2001 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2009 "lwin_wkt_parse.c"
     break;
 
   case 21:
-#line 247 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 244 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2007 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2015 "lwin_wkt_parse.c"
     break;
 
   case 22:
-#line 249 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 246 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COLLECTIONTYPE, NULL, NULL); WKT_ERROR(); }
-#line 2013 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2021 "lwin_wkt_parse.c"
     break;
 
   case 23:
-#line 253 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 250 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2019 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2027 "lwin_wkt_parse.c"
     break;
 
   case 24:
-#line 255 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 252 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2025 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2033 "lwin_wkt_parse.c"
     break;
 
   case 25:
-#line 259 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 256 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2031 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2039 "lwin_wkt_parse.c"
     break;
 
   case 26:
-#line 261 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 258 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2037 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2045 "lwin_wkt_parse.c"
     break;
 
   case 27:
-#line 263 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 260 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2043 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2051 "lwin_wkt_parse.c"
     break;
 
   case 28:
-#line 265 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 262 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTISURFACETYPE, NULL, NULL); WKT_ERROR(); }
-#line 2049 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2057 "lwin_wkt_parse.c"
     break;
 
   case 29:
-#line 269 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 266 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2055 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2063 "lwin_wkt_parse.c"
     break;
 
   case 30:
-#line 271 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 268 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2061 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2069 "lwin_wkt_parse.c"
     break;
 
   case 31:
-#line 273 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 270 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2067 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2075 "lwin_wkt_parse.c"
     break;
 
   case 32:
-#line 275 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 272 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2073 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2081 "lwin_wkt_parse.c"
     break;
 
   case 33:
-#line 277 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 274 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2079 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2087 "lwin_wkt_parse.c"
     break;
 
   case 34:
-#line 279 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 276 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2085 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2093 "lwin_wkt_parse.c"
     break;
 
   case 35:
-#line 283 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 280 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2091 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2099 "lwin_wkt_parse.c"
     break;
 
   case 36:
-#line 285 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 282 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2097 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2105 "lwin_wkt_parse.c"
     break;
 
   case 37:
-#line 287 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 284 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2103 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2111 "lwin_wkt_parse.c"
     break;
 
   case 38:
-#line 289 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 286 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(TINTYPE, NULL, NULL); WKT_ERROR(); }
-#line 2109 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2117 "lwin_wkt_parse.c"
     break;
 
   case 39:
-#line 293 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 290 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2115 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2123 "lwin_wkt_parse.c"
     break;
 
   case 40:
-#line 295 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 292 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2121 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2129 "lwin_wkt_parse.c"
     break;
 
   case 41:
-#line 297 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 294 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2127 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2135 "lwin_wkt_parse.c"
     break;
 
   case 42:
-#line 299 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 296 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(POLYHEDRALSURFACETYPE, NULL, NULL); WKT_ERROR(); }
-#line 2133 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2141 "lwin_wkt_parse.c"
     break;
 
   case 43:
-#line 303 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 300 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2139 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2147 "lwin_wkt_parse.c"
     break;
 
   case 44:
-#line 305 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 302 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2145 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2153 "lwin_wkt_parse.c"
     break;
 
   case 45:
-#line 307 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 304 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2151 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2159 "lwin_wkt_parse.c"
     break;
 
   case 46:
-#line 309 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 306 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOLYGONTYPE, NULL, NULL); WKT_ERROR(); }
-#line 2157 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2165 "lwin_wkt_parse.c"
     break;
 
   case 47:
-#line 313 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 310 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2163 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2171 "lwin_wkt_parse.c"
     break;
 
   case 48:
-#line 315 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 312 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2169 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2177 "lwin_wkt_parse.c"
     break;
 
   case 49:
-#line 319 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 316 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2175 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2183 "lwin_wkt_parse.c"
     break;
 
   case 50:
-#line 321 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 318 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2181 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2189 "lwin_wkt_parse.c"
     break;
 
   case 51:
-#line 325 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 322 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2187 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2195 "lwin_wkt_parse.c"
     break;
 
   case 52:
-#line 327 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 324 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2193 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2201 "lwin_wkt_parse.c"
     break;
 
   case 53:
-#line 329 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 326 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2199 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2207 "lwin_wkt_parse.c"
     break;
 
   case 54:
-#line 331 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 328 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); }
-#line 2205 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2213 "lwin_wkt_parse.c"
     break;
 
   case 55:
-#line 335 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 332 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); }
-#line 2211 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2219 "lwin_wkt_parse.c"
     break;
 
   case 56:
-#line 337 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 334 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_finalize(NULL, NULL); WKT_ERROR(); }
-#line 2217 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2225 "lwin_wkt_parse.c"
     break;
 
   case 57:
-#line 340 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 337 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[-1].geometryvalue); }
-#line 2223 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2231 "lwin_wkt_parse.c"
     break;
 
   case 58:
-#line 344 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 341 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2229 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2237 "lwin_wkt_parse.c"
     break;
 
   case 59:
-#line 346 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 343 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize((yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2235 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2243 "lwin_wkt_parse.c"
     break;
 
   case 60:
-#line 348 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 345 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2241 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2249 "lwin_wkt_parse.c"
     break;
 
   case 61:
-#line 350 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 347 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_finalize(NULL, NULL); WKT_ERROR(); }
-#line 2247 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2255 "lwin_wkt_parse.c"
     break;
 
   case 62:
-#line 354 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 351 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2253 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2261 "lwin_wkt_parse.c"
     break;
 
   case 63:
-#line 356 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 353 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_curvepolygon_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2259 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2267 "lwin_wkt_parse.c"
     break;
 
   case 64:
-#line 359 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 356 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 2265 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2273 "lwin_wkt_parse.c"
     break;
 
   case 65:
-#line 360 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 357 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 2271 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2279 "lwin_wkt_parse.c"
     break;
 
   case 66:
-#line 361 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 358 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 2277 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2285 "lwin_wkt_parse.c"
     break;
 
   case 67:
-#line 362 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 359 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = (yyvsp[0].geometryvalue); }
-#line 2283 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2291 "lwin_wkt_parse.c"
     break;
 
   case 68:
-#line 366 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 363 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); }
-#line 2289 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2297 "lwin_wkt_parse.c"
     break;
 
   case 69:
-#line 368 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 365 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'Z'); WKT_ERROR(); }
-#line 2295 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2303 "lwin_wkt_parse.c"
     break;
 
   case 70:
-#line 372 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 369 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_add_ring((yyvsp[-2].geometryvalue),(yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); }
-#line 2301 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2309 "lwin_wkt_parse.c"
     break;
 
   case 71:
-#line 374 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 371 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_polygon_new((yyvsp[0].ptarrayvalue),'2'); WKT_ERROR(); }
-#line 2307 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2315 "lwin_wkt_parse.c"
     break;
 
   case 72:
-#line 377 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 374 "lwin_wkt_parse.y"
     { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); }
-#line 2313 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2321 "lwin_wkt_parse.c"
     break;
 
   case 73:
-#line 380 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 377 "lwin_wkt_parse.y"
     { (yyval.ptarrayvalue) = (yyvsp[-1].ptarrayvalue); }
-#line 2319 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2327 "lwin_wkt_parse.c"
     break;
 
   case 74:
-#line 384 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 381 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COMPOUNDTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2325 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2333 "lwin_wkt_parse.c"
     break;
 
   case 75:
-#line 386 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 383 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COMPOUNDTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2331 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2339 "lwin_wkt_parse.c"
     break;
 
   case 76:
-#line 388 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 385 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COMPOUNDTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2337 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2345 "lwin_wkt_parse.c"
     break;
 
   case 77:
-#line 390 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 387 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(COMPOUNDTYPE, NULL, NULL); WKT_ERROR(); }
-#line 2343 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2351 "lwin_wkt_parse.c"
     break;
 
   case 78:
-#line 394 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 391 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2349 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2357 "lwin_wkt_parse.c"
     break;
 
   case 79:
-#line 396 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 393 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2355 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2363 "lwin_wkt_parse.c"
     break;
 
   case 80:
-#line 398 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 395 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2361 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2369 "lwin_wkt_parse.c"
     break;
 
   case 81:
-#line 400 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 397 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2367 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2375 "lwin_wkt_parse.c"
     break;
 
   case 82:
-#line 402 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 399 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2373 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2381 "lwin_wkt_parse.c"
     break;
 
   case 83:
-#line 404 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 401 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_compound_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2379 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2387 "lwin_wkt_parse.c"
     break;
 
   case 84:
-#line 408 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 405 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2385 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2393 "lwin_wkt_parse.c"
     break;
 
   case 85:
-#line 410 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 407 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2391 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2399 "lwin_wkt_parse.c"
     break;
 
   case 86:
-#line 412 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 409 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2397 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2405 "lwin_wkt_parse.c"
     break;
 
   case 87:
-#line 414 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 411 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTICURVETYPE, NULL, NULL); WKT_ERROR(); }
-#line 2403 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2411 "lwin_wkt_parse.c"
     break;
 
   case 88:
-#line 418 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 415 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2409 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2417 "lwin_wkt_parse.c"
     break;
 
   case 89:
-#line 420 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 417 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2415 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2423 "lwin_wkt_parse.c"
     break;
 
   case 90:
-#line 422 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 419 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2421 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2429 "lwin_wkt_parse.c"
     break;
 
   case 91:
-#line 424 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 421 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2427 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2435 "lwin_wkt_parse.c"
     break;
 
   case 92:
-#line 426 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 423 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2433 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2441 "lwin_wkt_parse.c"
     break;
 
   case 93:
-#line 428 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 425 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2439 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2447 "lwin_wkt_parse.c"
     break;
 
   case 94:
-#line 430 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 427 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2445 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2453 "lwin_wkt_parse.c"
     break;
 
   case 95:
-#line 432 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 429 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2451 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2459 "lwin_wkt_parse.c"
     break;
 
   case 96:
-#line 436 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 433 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2457 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2465 "lwin_wkt_parse.c"
     break;
 
   case 97:
-#line 438 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 435 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2463 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2471 "lwin_wkt_parse.c"
     break;
 
   case 98:
-#line 440 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 437 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2469 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2477 "lwin_wkt_parse.c"
     break;
 
   case 99:
-#line 442 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 439 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTILINETYPE, NULL, NULL); WKT_ERROR(); }
-#line 2475 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2483 "lwin_wkt_parse.c"
     break;
 
   case 100:
-#line 446 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 443 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2481 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2489 "lwin_wkt_parse.c"
     break;
 
   case 101:
-#line 448 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 445 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2487 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2495 "lwin_wkt_parse.c"
     break;
 
   case 102:
-#line 452 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 449 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2493 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2501 "lwin_wkt_parse.c"
     break;
 
   case 103:
-#line 454 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 451 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_circularstring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2499 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2507 "lwin_wkt_parse.c"
     break;
 
   case 104:
-#line 456 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 453 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2505 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2513 "lwin_wkt_parse.c"
     break;
 
   case 105:
-#line 458 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 455 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_circularstring_new(NULL, NULL); WKT_ERROR(); }
-#line 2511 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2519 "lwin_wkt_parse.c"
     break;
 
   case 106:
-#line 462 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 459 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2517 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2525 "lwin_wkt_parse.c"
     break;
 
   case 107:
-#line 464 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 461 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2523 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2531 "lwin_wkt_parse.c"
     break;
 
   case 108:
-#line 466 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 463 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2529 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2537 "lwin_wkt_parse.c"
     break;
 
   case 109:
-#line 468 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 465 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); }
-#line 2535 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2543 "lwin_wkt_parse.c"
     break;
 
   case 110:
-#line 472 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 469 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2541 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2549 "lwin_wkt_parse.c"
     break;
 
   case 111:
-#line 474 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 471 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_linestring_new(NULL, NULL); WKT_ERROR(); }
-#line 2547 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2555 "lwin_wkt_parse.c"
     break;
 
   case 112:
-#line 478 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 475 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2553 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2561 "lwin_wkt_parse.c"
     break;
 
   case 113:
-#line 480 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 477 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2559 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2567 "lwin_wkt_parse.c"
     break;
 
   case 114:
-#line 484 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 481 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2565 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2573 "lwin_wkt_parse.c"
     break;
 
   case 115:
-#line 486 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 483 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), (yyvsp[-5].stringvalue)); WKT_ERROR(); }
-#line 2571 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2579 "lwin_wkt_parse.c"
     break;
 
   case 116:
-#line 488 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 485 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2577 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2585 "lwin_wkt_parse.c"
     break;
 
   case 117:
-#line 490 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 487 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_triangle_new(NULL, NULL); WKT_ERROR(); }
-#line 2583 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2591 "lwin_wkt_parse.c"
     break;
 
   case 118:
-#line 494 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 491 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_triangle_new((yyvsp[-2].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2589 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2597 "lwin_wkt_parse.c"
     break;
 
   case 119:
-#line 498 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 495 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), NULL); WKT_ERROR(); }
-#line 2595 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2603 "lwin_wkt_parse.c"
     break;
 
   case 120:
-#line 500 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 497 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, (yyvsp[-1].geometryvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2601 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2609 "lwin_wkt_parse.c"
     break;
 
   case 121:
-#line 502 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 499 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2607 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2615 "lwin_wkt_parse.c"
     break;
 
   case 122:
-#line 504 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 501 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_finalize(MULTIPOINTTYPE, NULL, NULL); WKT_ERROR(); }
-#line 2613 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2621 "lwin_wkt_parse.c"
     break;
 
   case 123:
-#line 508 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 505 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_add_geom((yyvsp[-2].geometryvalue),(yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2619 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2627 "lwin_wkt_parse.c"
     break;
 
   case 124:
-#line 510 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 507 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_collection_new((yyvsp[0].geometryvalue)); WKT_ERROR(); }
-#line 2625 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2633 "lwin_wkt_parse.c"
     break;
 
   case 125:
-#line 514 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 511 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)),NULL); WKT_ERROR(); }
-#line 2631 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2639 "lwin_wkt_parse.c"
     break;
 
   case 126:
-#line 516 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 513 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new(wkt_parser_ptarray_new((yyvsp[-1].coordinatevalue)),NULL); WKT_ERROR(); }
-#line 2637 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2645 "lwin_wkt_parse.c"
     break;
 
   case 127:
-#line 518 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 515 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new(NULL, NULL); WKT_ERROR(); }
-#line 2643 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2651 "lwin_wkt_parse.c"
     break;
 
   case 128:
-#line 522 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 519 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), NULL); WKT_ERROR(); }
-#line 2649 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2657 "lwin_wkt_parse.c"
     break;
 
   case 129:
-#line 524 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 521 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new((yyvsp[-1].ptarrayvalue), (yyvsp[-3].stringvalue)); WKT_ERROR(); }
-#line 2655 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2663 "lwin_wkt_parse.c"
     break;
 
   case 130:
-#line 526 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 523 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new(NULL, (yyvsp[-1].stringvalue)); WKT_ERROR(); }
-#line 2661 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2669 "lwin_wkt_parse.c"
     break;
 
   case 131:
-#line 528 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 525 "lwin_wkt_parse.y"
     { (yyval.geometryvalue) = wkt_parser_point_new(NULL,NULL); WKT_ERROR(); }
-#line 2667 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2675 "lwin_wkt_parse.c"
     break;
 
   case 132:
-#line 532 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 529 "lwin_wkt_parse.y"
     { (yyval.ptarrayvalue) = wkt_parser_ptarray_add_coord((yyvsp[-2].ptarrayvalue), (yyvsp[0].coordinatevalue)); WKT_ERROR(); }
-#line 2673 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2681 "lwin_wkt_parse.c"
     break;
 
   case 133:
-#line 534 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 531 "lwin_wkt_parse.y"
     { (yyval.ptarrayvalue) = wkt_parser_ptarray_new((yyvsp[0].coordinatevalue)); WKT_ERROR(); }
-#line 2679 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2687 "lwin_wkt_parse.c"
     break;
 
   case 134:
-#line 538 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 535 "lwin_wkt_parse.y"
     { (yyval.coordinatevalue) = wkt_parser_coord_2((yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
-#line 2685 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2693 "lwin_wkt_parse.c"
     break;
 
   case 135:
-#line 540 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 537 "lwin_wkt_parse.y"
     { (yyval.coordinatevalue) = wkt_parser_coord_3((yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
-#line 2691 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2699 "lwin_wkt_parse.c"
     break;
 
   case 136:
-#line 542 "lwin_wkt_parse.y" /* yacc.c:1645  */
+#line 539 "lwin_wkt_parse.y"
     { (yyval.coordinatevalue) = wkt_parser_coord_4((yyvsp[-3].doublevalue), (yyvsp[-2].doublevalue), (yyvsp[-1].doublevalue), (yyvsp[0].doublevalue)); WKT_ERROR(); }
-#line 2697 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2705 "lwin_wkt_parse.c"
     break;
 
 
-#line 2701 "lwin_wkt_parse.c" /* yacc.c:1645  */
+#line 2709 "lwin_wkt_parse.c"
+
       default: break;
     }
   /* User semantic actions sometimes alter yychar, and that requires
@@ -2812,13 +2821,11 @@
 | yyerrorlab -- error raised explicitly by YYERROR.  |
 `---------------------------------------------------*/
 yyerrorlab:
+  /* Pacify compilers when the user code never invokes YYERROR and the
+     label yyerrorlab therefore never appears in user code.  */
+  if (0)
+    YYERROR;
 
-  /* Pacify compilers like GCC when the user code never invokes
-     YYERROR and the label yyerrorlab therefore never appears in user
-     code.  */
-  if (/*CONSTCOND*/ 0)
-     goto yyerrorlab;
-
   /* Do not reclaim the symbols of the rule whose action triggered
      this YYERROR.  */
   YYPOPSTACK (yylen);
@@ -2884,6 +2891,7 @@
   yyresult = 0;
   goto yyreturn;
 
+
 /*-----------------------------------.
 | yyabortlab -- YYABORT comes here.  |
 `-----------------------------------*/
@@ -2891,6 +2899,7 @@
   yyresult = 1;
   goto yyreturn;
 
+
 #if !defined yyoverflow || YYERROR_VERBOSE
 /*-------------------------------------------------.
 | yyexhaustedlab -- memory exhaustion comes here.  |
@@ -2901,6 +2910,10 @@
   /* Fall through.  */
 #endif
 
+
+/*-----------------------------------------------------.
+| yyreturn -- parsing is finished, return the result.  |
+`-----------------------------------------------------*/
 yyreturn:
   if (yychar != YYEMPTY)
     {
@@ -2930,6 +2943,6 @@
 #endif
   return yyresult;
 }
-#line 544 "lwin_wkt_parse.y" /* yacc.c:1903  */
+#line 541 "lwin_wkt_parse.y"
 
 

Modified: branches/2.5/liblwgeom/lwin_wkt_parse.h
===================================================================
--- branches/2.5/liblwgeom/lwin_wkt_parse.h	2019-10-10 13:01:09 UTC (rev 17900)
+++ branches/2.5/liblwgeom/lwin_wkt_parse.h	2019-10-10 13:01:34 UTC (rev 17901)
@@ -1,8 +1,9 @@
-/* A Bison parser, made by GNU Bison 3.2.2.  */
+/* A Bison parser, made by GNU Bison 3.4.  */
 
 /* Bison interface for Yacc-like parsers in C
 
-   Copyright (C) 1984, 1989-1990, 2000-2015, 2018 Free Software Foundation, Inc.
+   Copyright (C) 1984, 1989-1990, 2000-2015, 2018-2019 Free Software Foundation,
+   Inc.
 
    This program is free software: you can redistribute it and/or modify
    it under the terms of the GNU General Public License as published by
@@ -100,10 +101,9 @@
 
 /* Value type.  */
 #if ! defined YYSTYPE && ! defined YYSTYPE_IS_DECLARED
-
 union YYSTYPE
 {
-#line 115 "lwin_wkt_parse.y" /* yacc.c:1906  */
+#line 112 "lwin_wkt_parse.y"
 
 	int integervalue;
 	double doublevalue;
@@ -112,9 +112,9 @@
 	POINT coordinatevalue;
 	POINTARRAY *ptarrayvalue;
 
-#line 116 "lwin_wkt_parse.h" /* yacc.c:1906  */
+#line 116 "lwin_wkt_parse.h"
+
 };
-
 typedef union YYSTYPE YYSTYPE;
 # define YYSTYPE_IS_TRIVIAL 1
 # define YYSTYPE_IS_DECLARED 1

Modified: branches/2.5/liblwgeom/lwin_wkt_parse.y
===================================================================
--- branches/2.5/liblwgeom/lwin_wkt_parse.y	2019-10-10 13:01:09 UTC (rev 17900)
+++ branches/2.5/liblwgeom/lwin_wkt_parse.y	2019-10-10 13:01:34 UTC (rev 17901)
@@ -78,10 +78,7 @@
 			global_parser_result.message = parser_error_messages[PARSER_ERROR_OTHER];
 			global_parser_result.errlocation = wkt_yylloc.last_column;
 		}
-		/* Got a completed object parsed, but errored out after... */
-		/* Due to junk after the valid WKT, eg: "POINT(1 1) foobar" */
-		/* https://trac.osgeo.org/postgis/ticket/4273 */
-		if ( global_parser_result.errcode && ! parse_rv )
+		else if (global_parser_result.geom)
 		{
 			lwgeom_free(global_parser_result.geom);
 			global_parser_result.geom = NULL;



More information about the postgis-tickets mailing list