1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

transform_mjit_header.rb: apply Regexp.escape

to prevent future breakage

Following up r62285

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62287 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
k0kubun 2018-02-07 14:01:51 +00:00
parent 4d351c7b24
commit 13b376c561

View file

@ -135,7 +135,7 @@ module MJITHeader
# If code has macro which only supported compilers predefine, return true.
def self.supported_header?(code)
SUPPORTED_CC_MACROS.any? { |macro| code =~ /^#\s*define\s+#{macro}\b/ }
SUPPORTED_CC_MACROS.any? { |macro| code =~ /^#\s*define\s+#{Regexp.escape(macro)}\b/ }
end
end