Merge pull request #381 from Tschet1/fix_runaway_regex

Fix runaway regex
This commit is contained in:
Mark VanderVoord
2022-02-21 08:02:58 -05:00
committed by GitHub
+1 -1
View File
@@ -500,7 +500,7 @@ class CMockHeaderParser
end
# scan argument list for function pointers with shorthand notation and replace them with custom types
arg_list.gsub!(/([\w\s\*]+)+\s+(\w+)\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m|
arg_list.gsub!(/([\w\s\*]+)\s+(\w+)\s*\(((?:[\w\s\*]*,?)*)\s*\)*/) do |_m|
functype = "cmock_#{parse_project[:module_name]}_func_ptr#{parse_project[:typedefs].size + 1}"
funcret = Regexp.last_match(1).strip
funcname = Regexp.last_match(2).strip