Browse Source

ubsan: undefined shift in frag_align_code

* frags.c (MAX_MEM_FOR_RS_ALIGN_CODE): Avoid signed integer
	overflow.
binutils-2_39-branch
Alan Modra 4 years ago
parent
commit
e0ad09cfa5
  1. 2
      gas/frags.c

2
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

Loading…
Cancel
Save