From: Andy Polyakov Date: Wed, 2 Oct 2013 22:26:09 +0000 (+0200) Subject: x86_64-xlate.pl: fix jrcxz in nasm case. X-Git-Tag: OpenSSL_1_0_2-beta1~137 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=3aa1b1ccbbfaf1a89c590295d7a69de2e705a442;p=oweals%2Fopenssl.git x86_64-xlate.pl: fix jrcxz in nasm case. (cherry picked from commit 667053a2f3ad0788586f629f618d07b783bdde31) --- diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index fd3d7e4384..ead4a7d3b5 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl @@ -250,8 +250,8 @@ my %globals; # in $self->{label}, new gas requires sign extension... use integer; $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/\b([0-9]+\s*[\*\/\%]\s*[0-9]+)\b/eval($1)/eg; + $self->{label} =~ s/\b([0-9]+)\b/$1<<32>>32/eg; if (!$self->{label} && $self->{index} && $self->{scale}==1 && $self->{base} =~ /(rbp|r13)/) { @@ -418,7 +418,7 @@ my %globals; } sub out { my $self = shift; - if ($nasm && opcode->mnemonic()=~m/^j/) { + if ($nasm && opcode->mnemonic()=~m/^j(?![re]cxz)/) { "NEAR ".$self->{value}; } else { $self->{value};