aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ext/date/date_core.c2
-rw-r--r--gc.c2
-rw-r--r--iseq.c2
3 files changed, 3 insertions, 3 deletions
diff --git a/ext/date/date_core.c b/ext/date/date_core.c
index 251d025b12..ad9bc29a86 100644
--- a/ext/date/date_core.c
+++ b/ext/date/date_core.c
@@ -2378,7 +2378,7 @@ offset_to_sec(VALUE vof, int *rof)
n = FIX2LONG(vs);
if (n < -DAY_IN_SECONDS || n > DAY_IN_SECONDS)
return 0;
- *rof = n;
+ *rof = (int)n;
return 1;
}
}
diff --git a/gc.c b/gc.c
index f25f9cd48d..b79dcac481 100644
--- a/gc.c
+++ b/gc.c
@@ -504,7 +504,7 @@ rb_gc_set_params(void)
/* 2KB */
/*#define HEAP_SIZE 0x800 */
-#define HEAP_OBJ_LIMIT (HEAP_SIZE / sizeof(struct RVALUE))
+#define HEAP_OBJ_LIMIT (HEAP_SIZE / (unsigned int)sizeof(struct RVALUE))
extern st_table *rb_class_tbl;
diff --git a/iseq.c b/iseq.c
index 926a07da15..059038342f 100644
--- a/iseq.c
+++ b/iseq.c
@@ -1319,7 +1319,7 @@ iseq_data_to_ary(rb_iseq_t *iseq)
}
rb_ary_push(body, ary);
- pos += RARRAY_LEN(ary);
+ pos += RARRAY_LENINT(ary); /* reject too huge data */
}
st_free_table(labels_table);