projects
/
binutils-gdb.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
53f2b36
)
ubsan: undefined shift in frag_align_code
author
Alan Modra
<amodra@gmail.com>
Thu, 2 Jun 2022 06:40:30 +0000
(16:10 +0930)
committer
Alan Modra
<amodra@gmail.com>
Thu, 2 Jun 2022 06:40:30 +0000
(16:10 +0930)
* frags.c (MAX_MEM_FOR_RS_ALIGN_CODE): Avoid signed integer
overflow.
gas/frags.c
patch
|
blob
|
history
diff --git
a/gas/frags.c
b/gas/frags.c
index f5afe1a49b5e536b7702d719cc369d6ee91679bc..8e88496f37c352d1b0f3648f77f92b5e50def8b3 100644
(file)
--- a/
gas/frags.c
+++ b/
gas/frags.c
@@
-367,7
+367,7
@@
frag_align_pattern (int alignment, const char *fill_pattern,
# ifndef HANDLE_ALIGN
# define MAX_MEM_FOR_RS_ALIGN_CODE 1
# else
-# define MAX_MEM_FOR_RS_ALIGN_CODE ((1 << alignment) - 1)
+# define MAX_MEM_FOR_RS_ALIGN_CODE ((
(size_t)
1 << alignment) - 1)
# endif
#endif