From: Andy Polyakov Date: Tue, 19 Jan 2010 16:15:23 +0000 (+0000) Subject: x86_64-xlate.pl: refine sign extension logic when handling lea. X-Git-Tag: OpenSSL-fips-2_0-rc1~1339 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=ee2b8ed2f535660950ceefb21de62d880bcf7f34;p=openssl x86_64-xlate.pl: refine sign extension logic when handling lea. PR: 2094,2095 --- diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 25f8c4e83f..e4fc17bdbd 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -243,8 +243,9 @@ my %globals; # Solaris /usr/ccs/bin/as can't handle multiplications # in $self->{label}, new gas requires sign extension... use integer; - $self->{label} =~ s/(?>32/egi; + $self->{label} =~ s/(?{label} =~ s/([0-9]+\s*[\*\/\%]\s*[0-9]+)/eval($1)/eg; + $self->{label} =~ s/([0-9]+)/$1<<32>>32/eg; $self->{label} =~ s/^___imp_/__imp__/ if ($flavour eq "mingw64"); if (defined($self->{index})) {