Skip to content

Commit

Permalink
PR27101, as: Reject (byte) .align 0x100000000
Browse files Browse the repository at this point in the history
This allows alignments up to 2**TC_ALIGN_LIMIT, which might be larger
than an unsigned int can hold.

	PR 27101
	* read.c (s_align): Use a large enough type for "align" to hold
	the result of get_absolute_expression.
  • Loading branch information
amodra committed Jan 4, 2021
1 parent a68494d commit 90320e4
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
6 changes: 6 additions & 0 deletions gas/ChangeLog
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
2021-01-04 Alan Modra <[email protected]>

PR 27101
* read.c (s_align): Use a large enough type for "align" to hold
the result of get_absolute_expression.

2021-01-01 Nicolas Boulenguez <[email protected]>

* config/tc-i386.c: Correct comment spelling.
Expand Down
4 changes: 2 additions & 2 deletions gas/read.c
Original file line number Diff line number Diff line change
Expand Up @@ -1548,7 +1548,7 @@ static void
s_align (signed int arg, int bytes_p)
{
unsigned int align_limit = TC_ALIGN_LIMIT;
unsigned int align;
addressT align;
char *stop = NULL;
char stopc = 0;
offsetT fill = 0;
Expand Down Expand Up @@ -1595,7 +1595,7 @@ s_align (signed int arg, int bytes_p)
if (align > align_limit)
{
align = align_limit;
as_warn (_("alignment too large: %u assumed"), align);
as_warn (_("alignment too large: %u assumed"), align_limit);
}

if (*input_line_pointer != ',')
Expand Down

0 comments on commit 90320e4

Please sign in to comment.