Opened 7 years ago

Closed 7 years ago

#3880 closed defect (fixed)

Undefined behaviour in TYPMOD_GET_SRID

Reported by: Raul Marin Owned by: pramsey
Priority: medium Milestone: PostGIS 2.2.6
Component: postgis Version: master
Keywords: Cc:

Description

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

Change History (4)

comment:1 by pramsey, 7 years ago

In 15914:

Undefined behaviour in TYPMOD_GET_SRID
References #3880

comment:2 by pramsey, 7 years ago

In 15915:

Undefined behaviour in TYPMOD_GET_SRID
References #3880

comment:3 by pramsey, 7 years ago

In 15916:

Undefined behaviour in TYPMOD_GET_SRID
References #3880

comment:4 by pramsey, 7 years ago

Resolution: fixed
Status: newclosed

In 15917:

Undefined behaviour in TYPMOD_GET_SRID
Closes #3880

Note: See TracTickets for help on using tickets.