mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
vm.c: fix conversion warning in send_method visibility error path
Cast RARRAY_LEN result to int in send_method when handling visibility errors to resolve C4244 warning about potential data loss from mrb_ssize to int conversion. The cast is safe since n represents argument count which should fit in int range. Co-authored-by: Claude <noreply@anthropic.com>
This commit is contained in:
@@ -1004,7 +1004,7 @@ send_method(mrb_state *mrb, mrb_value self, mrb_bool pub)
|
||||
if (m.flags & MRB_METHOD_PRIVATE_FL) {
|
||||
vis_err:;
|
||||
if (n == 15) {
|
||||
n = RARRAY_LEN(regs[0]) - 1;
|
||||
n = (int)(RARRAY_LEN(regs[0]) - 1);
|
||||
regs = RARRAY_PTR(regs[0]);
|
||||
}
|
||||
vis_error(mrb, name, mrb_ary_new_from_values(mrb, n, regs+1), self, priv);
|
||||
|
||||
Reference in New Issue
Block a user