diff options
author | 2021-09-11 01:42:49 +0800 | |
---|---|---|
committer | 2021-09-11 01:50:45 +0800 | |
commit | 7fae86c62a9ffeb94a7c11f1660c94873368dcec (patch) | |
tree | 6b5ff39982b80ea16856ee8bd39132047de4b8ae /compiler/utils/assembler_test_base.h | |
parent | 1c494e36f246a982070e125dec3c1139f9289c6e (diff) |
Make sure only comments are stripped
The regex " +#.*" could also match immediates on ARM, e.g.
cmp r1, #1234
Fix it by requiring a space after the hash mark.
Test: art_compiler_host_tests
Change-Id: I3cf038ff6547edad8a417961d8bb2b27c0872f51
Diffstat (limited to 'compiler/utils/assembler_test_base.h')
-rw-r--r-- | compiler/utils/assembler_test_base.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/compiler/utils/assembler_test_base.h b/compiler/utils/assembler_test_base.h index 73318639c2..bf73808603 100644 --- a/compiler/utils/assembler_test_base.h +++ b/compiler/utils/assembler_test_base.h @@ -252,7 +252,7 @@ class AssemblerTestBase : public testing::Test { // Remove comments emitted by objdump. std::string StripComments(const std::string& str) { - return std::regex_replace(str, std::regex(" +#.*"), ""); + return std::regex_replace(str, std::regex(" +# .*"), ""); } std::optional<ScratchDir> scratch_dir_; |