]> git.eshelyaron.com Git - emacs.git/commit
Remove some undefined behavior related to left shifts.
authorPhilipp Stephani <phst@google.com>
Mon, 23 Dec 2019 20:24:37 +0000 (21:24 +0100)
committerPhilipp Stephani <phst@google.com>
Mon, 23 Dec 2019 20:27:23 +0000 (21:27 +0100)
commit00c9949158e82fc93135ac62013bee1c08161649
treee4905c8be7020ad36d54528a3b10d8cbab79cd0b
parent17c19817f7f4ec918a3a9bb3c957b1aa0463da82
Remove some undefined behavior related to left shifts.

Found by UBSan.

* src/nsfns.m (ns_set_foreground_color, ns_set_background_color):
* src/nsimage.m (getPixelAtX:Y:):
* src/nsterm.m (ns_color_index_to_rgba): Add explicit casts to avoid
undefined behavior when left-shifting beyond the bounds of the int
type.

* src/macfont.m (METRICS_VALUE): Add explicit casts to avoid undefined
behavior when left-shifting a negative value.
src/macfont.m
src/nsfns.m
src/nsimage.m
src/nsterm.m