perlasm/x86_64-xlate.pl: work around problem with hex constants in masm.
authorAndy Polyakov <appro@openssl.org>
Thu, 4 May 2017 13:54:29 +0000 (15:54 +0200)
committerAndy Polyakov <appro@openssl.org>
Fri, 5 May 2017 14:57:18 +0000 (16:57 +0200)
Perl, multiple versions, for some reason occasionally takes issue with
letter b[?] in ox([0-9a-f]+) regex. As result some constants, such as
0xb1 came out wrong when generating code for MASM. Fixes GH#3241.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/3385)

(cherry picked from commit c47aea8af1e28e46e1ad5e2e7468b49fec3f4f29)

crypto/perlasm/x86_64-xlate.pl

index 625f95cd3c3eb8259b470298a833b49c0cfbc2d6..d19195ea06a87d37658f30255cc32a564f5548bf 100755 (executable)
@@ -206,8 +206,9 @@ my %globals;
            }
            sprintf "\$%s",$self->{value};
        } else {
-           $self->{value} =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
-           sprintf "%s",$self->{value};
+           my $value = $self->{value};
+           $value =~ s/0x([0-9a-f]+)/0$1h/ig if ($masm);
+           sprintf "%s",$value;
        }
     }
 }