try to convert not only nil but every objects to fixnums; ref #2677

parent 05b00a14
...@@ -781,7 +781,10 @@ num_index: ...@@ -781,7 +781,10 @@ num_index:
} }
} }
default: default:
if (mrb_nil_p(indx)) mrb_raise(mrb, E_TYPE_ERROR, "can't convert nil into Integer"); indx = mrb_Integer(mrb, indx);
if (mrb_nil_p(indx)) {
mrb_raise(mrb, E_TYPE_ERROR, "can't convert to Fixnum");
}
idx = mrb_fixnum(indx); idx = mrb_fixnum(indx);
goto num_index; goto num_index;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment