summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-io
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2018-09-19 21:51:53 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2018-11-19 12:05:46 +0900
commitff08856fe314faa4d16b4502c0960a3475387846 (patch)
tree5e5bd17dc3d05a9be4c02fe80d3ecfea0ff68269 /mrbgems/mruby-io
parentafca99a40b8a3415b3a9a0e8fc41c93ddcbb11d8 (diff)
downloadmruby-ff08856fe314faa4d16b4502c0960a3475387846.tar.gz
mruby-ff08856fe314faa4d16b4502c0960a3475387846.zip
Remove implicit conversion using `to_str` method; fix #3854
We have added internal convenience method `__to_str` which does string type check. The issue #3854 was fixed but fundamental flaw of lack of stack depth check along with fibers still remains. Use `MRB_GC_FIXED_ARENA` for workaround.
Diffstat (limited to 'mrbgems/mruby-io')
-rw-r--r--mrbgems/mruby-io/src/file.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mrbgems/mruby-io/src/file.c b/mrbgems/mruby-io/src/file.c
index e65741061..c00663481 100644
--- a/mrbgems/mruby-io/src/file.c
+++ b/mrbgems/mruby-io/src/file.c
@@ -115,7 +115,7 @@ mrb_file_s_unlink(mrb_state *mrb, mrb_value obj)
mrb_get_args(mrb, "*", &argv, &argc);
for (i = 0; i < argc; i++) {
const char *utf8_path;
- pathv = mrb_convert_type(mrb, argv[i], MRB_TT_STRING, "String", "to_str");
+ pathv = mrb_ensure_string_type(mrb, argv[i]);
utf8_path = mrb_string_value_cstr(mrb, &pathv);
path = mrb_locale_from_utf8(utf8_path, -1);
if (UNLINK(path) < 0) {