perlasm/x86_64-xlate.pl: pass pure constants verbatim.
authorAndy Polyakov <appro@openssl.org>
Wed, 10 Feb 2016 14:11:40 +0000 (15:11 +0100)
committerAndy Polyakov <appro@openssl.org>
Thu, 11 Feb 2016 20:07:44 +0000 (21:07 +0100)
RT#3885

Reviewed-by: Rich Salz <rsalz@openssl.org>
crypto/perlasm/x86_64-xlate.pl

index 87f69562527c191d6ab0e8db102054d51a7f023c..1f5bced8e162e0e35eface009ea414fbdddffbd2 100755 (executable)
@@ -198,8 +198,11 @@ my %globals;
        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;