mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
mruby-io (mrb_file_size): add check for MRB_32BIT and MRB_INT64
This commit is contained in:
@@ -654,7 +654,7 @@ mrb_file_size(mrb_state *mrb, mrb_value self)
|
||||
mrb_sys_fail(mrb, "fstat");
|
||||
}
|
||||
|
||||
if (st.st_size > MRB_INT_MAX) {
|
||||
if (sizeof(st.st_size) >= sizeof(mrb_int) && st.st_size > MRB_INT_MAX) {
|
||||
#ifdef MRB_NO_FLOAT
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "File#size too large for MRB_NO_FLOAT");
|
||||
#else
|
||||
|
||||
Reference in New Issue
Block a user