From: Julien Pagès Date: Fri, 18 Jul 2014 14:24:23 +0000 (+0200) Subject: nitvm: fix a crash caused by a bad allocation of virtual tables X-Git-Tag: v0.6.7~45^2 X-Git-Url: http://nitlanguage.org?hp=51068f56d2094f8caabfc9e4bacd0cc34cea3fb7 nitvm: fix a crash caused by a bad allocation of virtual tables Signed-off-by: Julien Pagès --- diff --git a/src/vm.nit b/src/vm.nit index eed0d47..0cb7961 100644 --- a/src/vm.nit +++ b/src/vm.nit @@ -405,8 +405,9 @@ class MemoryManager total_size += 2; } - // Add the size of the perfect hashtable - total_size += mask+1; + // Add the size of the perfect hashtable (mask +1) + // Add one because we start to fill the vtable at position 1 (0 is the init position) + total_size += mask+2; long unsigned int* vtable = malloc(sizeof(long unsigned int)*total_size); // Initialisation to the first position of the virtual table (ie : Object)