[postgis-tickets] [PostGIS] #3880: Undefined behaviour in TYPMOD_GET_SRID

PostGIS trac at osgeo.org
Fri Oct 6 02:18:59 PDT 2017


#3880: Undefined behaviour in TYPMOD_GET_SRID
------------------------+---------------------------
 Reporter:  Raul Marin  |      Owner:  pramsey
     Type:  defect      |     Status:  new
 Priority:  medium      |  Milestone:  PostGIS 2.2.6
Component:  postgis     |    Version:  trunk
 Keywords:              |
------------------------+---------------------------
 Some output examples using undefined behaviour sanitizer:
 {{{
 Running test 'test_typmod_macros' in suite
 'serialization/deserialization'.
 cu_libgeom.c:35:7: runtime error: left shift of 535589632 by 3 places
 cannot be represented in type 'int'
 cu_libgeom.c:45:14: runtime error: left shift of 280871168 by 3 places
 cannot be represented in type 'int'
 }}}

 Basically it's at the mercy of how the compiler/cpu decides to handle the
 shift.

 PR in Github with the fix:  https://github.com/postgis/postgis/pull/152

--
Ticket URL: <https://trac.osgeo.org/postgis/ticket/3880>
PostGIS <http://trac.osgeo.org/postgis/>
The PostGIS Trac is used for bug, enhancement & task tracking, a user and developer wiki, and a view into the subversion code repository of PostGIS project.


More information about the postgis-tickets mailing list