ruby-changes:50169
From: k0kubun <ko1@a...>
Date: Wed, 7 Feb 2018 23:01:56 +0900 (JST)
Subject: [ruby-changes:50169] k0kubun:r62287 (trunk): transform_mjit_header.rb: apply Regexp.escape
k0kubun 2018-02-07 23:01:51 +0900 (Wed, 07 Feb 2018) New Revision: 62287 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=62287 Log: transform_mjit_header.rb: apply Regexp.escape to prevent future breakage Following up r62285 Modified files: trunk/tool/transform_mjit_header.rb Index: tool/transform_mjit_header.rb =================================================================== --- tool/transform_mjit_header.rb (revision 62286) +++ tool/transform_mjit_header.rb (revision 62287) @@ -135,7 +135,7 @@ module MJITHeader https://github.com/ruby/ruby/blob/trunk/tool/transform_mjit_header.rb#L135 # 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 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/