summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--copy.c2
-rw-r--r--instance_table.c4
2 files changed, 3 insertions, 3 deletions
diff --git a/copy.c b/copy.c
index 12610e6..178a1d2 100644
--- a/copy.c
+++ b/copy.c
@@ -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;