]> granicus.if.org Git - postgis/commitdiff
Fix grammar file to work around suspected bison 3.0.2 bug
authorSandro Santilli <strk@keybit.net>
Fri, 5 Sep 2014 14:38:23 +0000 (14:38 +0000)
committerSandro Santilli <strk@keybit.net>
Fri, 5 Sep 2014 14:38:23 +0000 (14:38 +0000)
See http://lists.osgeo.org/pipermail/postgis-devel/2014-September/024507.html

git-svn-id: http://svn.osgeo.org/postgis/trunk@12946 b70326c6-7e19-0410-871a-916f4a2858ee

liblwgeom/lwin_wkt_parse.y

index 9a937d1c6a842c99a3e567b2ebe05841cfdbc7d8..9c74545e4ac91e59a4d5789c96e1e51d0b9f961c 100644 (file)
@@ -50,7 +50,15 @@ int lwgeom_parse_wkt(LWGEOM_PARSER_RESULT *parser_result, char *wktstr, int pars
        int parse_rv = 0;
 
        /* Clean up our global parser result. */
-    lwgeom_parser_result_init(&global_parser_result);
+       lwgeom_parser_result_init(&global_parser_result);
+       /* Work-around possible bug in GNU Bison 3.0.2 resulting in wkt_yylloc
+        * members not being initialized on yyparse() as documented here:
+        * https://www.gnu.org/software/bison/manual/html_node/Location-Type.html
+        * See discussion here:
+        * http://lists.osgeo.org/pipermail/postgis-devel/2014-September/024506.html
+        */
+       wkt_yylloc.last_column = wkt_yylloc.last_line = \
+       wkt_yylloc.first_column = wkt_yylloc.first_line = 1;
 
        /* Set the input text string, and parse checks. */
        global_parser_result.wkinput = wktstr;