summaryrefslogtreecommitdiff
path: root/gdb/ChangeLog
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2018-08-17 20:19:13 -0600
committerTom Tromey <tom@tromey.com>2018-10-03 15:19:06 -0600
commit4dd1b46077b2ae7331f274f7888733de5166445c (patch)
treed23e75ce337d75dbd09e648aab85b5a68ac80244 /gdb/ChangeLog
parent20562150d8a894bc91657c843ee88c508188e32e (diff)
downloadbinutils-gdb-4dd1b46077b2ae7331f274f7888733de5166445c.tar.gz
Avoid undefined behavior in read_signed_leb128
-fsanitize=undefined pointed out that read_signed_leb128 had an undefined left-shift when processing the final byte of a 64-bit leb: runtime error: left shift of 127 by 63 places cannot be represented in type 'long int' and an undefined negation: runtime error: negation of -9223372036854775808 cannot be represented in type 'long int'; cast to an unsigned type to negate this value to itself Both of these problems are readily avoided by havinng read_signed_leb128 work in an unsigned type, and then casting to the signed type at the return. gdb/ChangeLog 2018-10-03 Tom Tromey <tom@tromey.com> * dwarf2read.c (read_signed_leb128): Work in ULONGEST.
Diffstat (limited to 'gdb/ChangeLog')
-rw-r--r--gdb/ChangeLog4
1 files changed, 4 insertions, 0 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index 97ee73bab38..9731c99a6a2 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,9 @@
2018-10-03 Tom Tromey <tom@tromey.com>
+ * dwarf2read.c (read_signed_leb128): Work in ULONGEST.
+
+2018-10-03 Tom Tromey <tom@tromey.com>
+
* c-exp.y (parse_number): Work in unsigned. Remove casts.
2018-10-03 Tom Tromey <tom@tromey.com>