From 43644757bea4f333bc1691820546bb5af4e72183 Mon Sep 17 00:00:00 2001 From: fennecdjay Date: Sun, 19 May 2019 02:33:41 +0200 Subject: [PATCH] :art: Few fixes --- src/lib/import.c | 4 +--- src/vm/vm_name.c | 2 +- src/vm/vm_shred.c | 2 +- 3 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/lib/import.c b/src/lib/import.c index 039f75e0..ce6068c7 100644 --- a/src/lib/import.c +++ b/src/lib/import.c @@ -267,9 +267,7 @@ ANN m_int gwi_class_ext(const Gwi gwi, Type_Decl* td) { ANN m_int gwi_class_end(const Gwi gwi) { if(!gwi->gwion->env->class_def) GWI_ERR_B("import: too many class_end called.") - const Nspc nspc = gwi->gwion->env->class_def->nspc; - if(nspc->info->class_data_size && !nspc->info->class_data) - nspc->info->class_data = (m_bit*)xcalloc(1, nspc->info->class_data_size); + nspc_allocdata(gwi->gwion->env->class_def->nspc); env_pop(gwi->gwion->env, 0); return GW_OK; } diff --git a/src/vm/vm_name.c b/src/vm/vm_name.c index 851f1817..458fe63d 100644 --- a/src/vm/vm_name.c +++ b/src/vm/vm_name.c @@ -6,7 +6,7 @@ m_str code_name_set(const m_str name, const m_str file) { const size_t len = strlen(name) + strlen(file) + 2; - const m_str str = (const m_str)xcalloc(1, len); + m_str str = (const m_str)xcalloc(1, len); sprintf(str, "%s$%s", name, file); return str; } diff --git a/src/vm/vm_shred.c b/src/vm/vm_shred.c index aa35302f..e4edcebd 100644 --- a/src/vm/vm_shred.c +++ b/src/vm/vm_shred.c @@ -27,7 +27,7 @@ static inline void free_shredinfo(MemPool mp, struct ShredInfo_ *info) { const Vector v = info->args; LOOP_OPTIM for(m_uint i = vector_size(v) + 1; --i;) - free((void*)vector_at(v, i - 1)); + xfree((void*)vector_at(v, i - 1)); free_vector(mp, v); } mp_free(mp, ShredInfo, info); // ??? info->p -- 2.43.0