Skip to content

Commit

Permalink
Fix handling of the "0:" label in arm-xlate.pl
Browse files Browse the repository at this point in the history
When $label == "0", $label is not truthy, so `if ($label)` thinks there isn't
a label. Correct this by looking at the result of the s/// command.

Verified that there are no changes in the .S files created during a normal
build, and that the "0:" labels appear in the translation given in the error
report (and they are the only difference in the before and after output).

Fixes #21647

Change-Id: I5f2440100c62360bf4bdb7c7ece8dddd32553c79

Reviewed-by: Paul Dale <pauli@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from #21653)

(cherry picked from commit 9607f5c)
  • Loading branch information
tom-cosgrove-arm authored and t8m committed Aug 8, 2023
1 parent 2d79662 commit 89661d4
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crypto/perlasm/arm-xlate.pl
Expand Up @@ -159,9 +159,8 @@ sub expand_line {
}

{
$line =~ s|(^[\.\w]+)\:\s*||;
my $label = $1;
if ($label) {
if ($line =~ s|(^[\.\w]+)\:\s*||) {
my $label = $1;
printf "%s:",($GLOBALS{$label} or $label);
}
}
Expand Down

0 comments on commit 89661d4

Please sign in to comment.