diff options
-rw-r--r-- | copy.c | 2 | ||||
-rw-r--r-- | instance_table.c | 4 |
2 files changed, 3 insertions, 3 deletions
@@ -46,7 +46,7 @@ static void copy_val(Allocator *a, Value *out, Value *in, Type *t) { *out = *in; break; case TYPE_ARR: { - size_t bytes = t->arr.n * compiler_sizeof(t->arr.of); + size_t bytes = (size_t)t->arr.n * compiler_sizeof(t->arr.of); out->arr = allocr_malloc(a, bytes); memcpy(out->arr, in->arr, bytes); } break; diff --git a/instance_table.c b/instance_table.c index 979d030..33a7eba 100644 --- a/instance_table.c +++ b/instance_table.c @@ -330,8 +330,8 @@ static Instance *instance_table_adda(Allocator *a, HashTable *h, Value v, Type * } h->data = new_data; h->occupied = new_occupied; - allocr_free(a, old_occupied, h->cap * sizeof *old_occupied); - allocr_free(a, old_data, h->cap * sizeof *old_data); + allocr_free(a, old_occupied, (size_t)h->cap * sizeof *old_occupied); + allocr_free(a, old_data, (size_t)h->cap * sizeof *old_data); h->cap = new_cap; } Instance **data = h->data; |