commit | 24a18b8a40e876f828a5ce185849d46f19c671e8 | [log] [tgz] |
---|---|---|
author | David Benjamin <davidben@google.com> | Wed Feb 20 18:29:40 2019 -0600 |
committer | Adam Langley <agl@google.com> | Thu Feb 21 16:50:17 2019 +0000 |
tree | 39d598c55a5236174111c7d221b5985c42ba7750 | |
parent | 1908667015d5cc28876971b789c338f81447aaee [diff] |
Fix x86_64-xlate.pl comment regex. This did not correctly capture lines like the following: https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/chacha/asm/chacha-x86_64.pl#260 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/aes/asm/aes-x86_64.pl#992 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/aes/asm/aesni-x86_64.pl#641 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/aes/asm/bsaes-x86_64.pl#387 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/modes/asm/ghash-x86_64.pl#455 https://boringssl.googlesource.com/boringssl/+/refs/heads/master/crypto/fipsmodule/ec/asm/p256-x86_64-asm.pl#92 Reportedly that last one causes problems with some assemblers. Change-Id: I82d6f0d81b902e48fad3c45947f84f02370eb1ab Reviewed-on: https://boringssl-review.googlesource.com/c/34925 Reviewed-by: Adam Langley <agl@google.com>
diff --git a/crypto/perlasm/x86_64-xlate.pl b/crypto/perlasm/x86_64-xlate.pl index 74fb32f..f928411 100755 --- a/crypto/perlasm/x86_64-xlate.pl +++ b/crypto/perlasm/x86_64-xlate.pl
@@ -1188,8 +1188,11 @@ $line =~ s|[#!].*$||; # get rid of asm-style comments... } else { # Get rid of asm-style comments but not preprocessor directives. The - # latter are identified by not having a space after the '#'. - $line =~ s|[#!] .*$||; + # former are identified by having a letter after the '#' and starting in + # the first column. + $line =~ s|!.*$||; + $line =~ s|(?<=.)#.*$||; + $line =~ s|^#([^a-z].*)?$||; } $line =~ s|/\*.*\*/||; # ... and C-style comments...