]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
_mul_overflow and get_encoded_value
authorAlan Modra <amodra@gmail.com>
Sat, 15 May 2021 05:06:26 +0000 (14:36 +0930)
committerAlan Modra <amodra@gmail.com>
Sat, 15 May 2021 05:06:54 +0000 (14:36 +0930)
commitfc5e0925d4bff79c8c036cf00803112a1ec04188
treed71d622247fdaadaa710ece3fdce8bfb9ffc2289
parent7c96e6120f1b9b5025629bbe995ca55d1be8f36f
_mul_overflow and get_encoded_value

A sufficiently mad compiler optimiser can take undefined behaviour
according to the C standard as an opportunity to remove code.  Since
"data + size" might be seen to be past the end of an array,
calculating such an expression is UB.

_mul_overflow is infrastructure for later patches.

* bucomm.h (_mul_overflow): Define.
* dwarf.c (get_encoded_value): Avoid pointer UB.
binutils/ChangeLog
binutils/bucomm.h
binutils/dwarf.c