mirror of
https://sourceware.org/git/binutils-gdb.git
synced 2024-11-21 01:12:32 +08:00
ubsan: undefined shift in frag_align_code
* frags.c (MAX_MEM_FOR_RS_ALIGN_CODE): Avoid signed integer overflow.
This commit is contained in:
parent
53f2b36a54
commit
e0ad09cfa5
@ -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
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user