Skip to content

Commit

Permalink
perlasm/x86_64-xlate.pl: pass pure constants verbatim.
Browse files Browse the repository at this point in the history
RT#3885

Reviewed-by: Rich Salz <rsalz@openssl.org>
(cherry picked from commit fd7dc20)
  • Loading branch information
Andy Polyakov committed Feb 11, 2016
1 parent 0fffd52 commit 10c639a
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions crypto/perlasm/x86_64-xlate.pl
Original file line number Diff line number Diff line change
Expand Up @@ -198,8 +198,11 @@
if ($gas) {
# Solaris /usr/ccs/bin/as can't handle multiplications
# in $self->{value}
$self->{value} =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/oct($1)/egi;
$self->{value} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg;
my $value = $self->{value};
$value =~ s/(?<![\w\$\.])(0x?[0-9a-f]+)/oct($1)/egi;
if ($value =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg) {
$self->{value} = $value;
}
sprintf "\$%s",$self->{value};
} else {
$self->{value} =~ s/(0b[0-1]+)/oct($1)/eig;
Expand Down

0 comments on commit 10c639a

Please sign in to comment.