Pass pure constants verbatim in perlasm/x86_64-xlate.pl (Imported from upstream's 10c639a8a56c90bec9e332c7ca76ef552b3952ac) Change-Id: Ia8203eeae9d274249595a6e352ec2f77a97ca5d5 Reviewed-on: https://boringssl-review.googlesource.com/7227 Reviewed-by: David Benjamin <davidben@google.com>
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 3ebb018..79c3c03 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl
@@ -193,8 +193,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;