x86_64-xlate.pl: refine sign extension logic when handling lea.
authorAndy Polyakov <appro@openssl.org>
Tue, 19 Jan 2010 16:15:23 +0000 (16:15 +0000)
committerAndy Polyakov <appro@openssl.org>
Tue, 19 Jan 2010 16:15:23 +0000 (16:15 +0000)
PR: 2094,2095

crypto/perlasm/x86_64-xlate.pl

index 25f8c4e..e4fc17b 100755 (executable)
@@ -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/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)<<32>>32/egi;
+           $self->{label} =~ s/(?<![0-9a-f])(0[x0-9a-f]+)/oct($1)/egi;
            $self->{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})) {