mattn / mruby-onig-regexp

mrbgem of 鬼雲's Regular Expression
31 stars 36 forks source link

infinite loop when empty regexp #50

Closed ksss closed 7 years ago

ksss commented 7 years ago
"hello".gsub(//, ".")
# Expect => ".h.e.l.l.o."
# Actual => infinite loop

See also https://github.com/ruby/spec/blob/0fe99d24f4a17eaa39563623209747eee278c3d1/core/string/gsub_spec.rb#L25

https://github.com/ruby/ruby/blob/745f4dd5b834a00f1cc201adb72ea3c8c8d4decb/string.c#L5005-L5006

mattn commented 7 years ago

strange! https://travis-ci.org/mattn/mruby-onig-regexp/builds/206859000

ksss commented 7 years ago

@mattn Thanks ✨