GNOME Bugzilla – Bug 762748
Undefined behavior
Last modified: 2016-03-01 15:36:28 UTC
gcc's --fsanitize=undefined flags these when running make check: gparam.c:472:27: runtime error: left shift of negative value -1 gdbusconnection.c:2603:51: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' gdbusconnection.c:5888:17: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' gdbusconnection.c:5927:15: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' gdbusconnection.c:5928:19: runtime error: left shift of 1 by 31 places cannot be represented in type 'int' gdbusconnection.c:1611:33: runtime error: left shift of 1 by 31 places cannot be represented in type 'int'
Created attachment 322662 [details] [review] GDBusConnection: use uint for bitshifts "1 << 31" is not well-defined, do use "1u << 31" instead.
Review of attachment 322662 [details] [review]: yeah, looks right
Attachment 322662 [details] pushed as b54acf5 - GDBusConnection: use uint for bitshifts