Explorar el Código

Fixed enum params offset (#76)

Pascal Peridont hace 8 años
padre
commit
e6794e5876
Se han modificado 1 ficheros con 2 adiciones y 2 borrados
  1. 2 2
      src/std/types.c

+ 2 - 2
src/std/types.c

@@ -345,7 +345,7 @@ HL_PRIM void hl_init_enum( hl_type *et, hl_module_context *m ) {
 	for(i=0;i<et->tenum->nconstructs;i++) {
 		hl_enum_construct *c = et->tenum->constructs + i;
 		c->hasptr = false;
-		c->size = sizeof(venum); // t + index
+		c->size = sizeof(void*)+sizeof(int); // t + index
 		for(j=0;j<c->nparams;j++) {
 			hl_type *t = c->params[j];
 			c->size += hl_pad_struct(c->size,t);
@@ -557,4 +557,4 @@ DEFINE_PRIM(_ARR, type_enum_values, _TYPE);
 DEFINE_PRIM(_BOOL, type_enum_eq, _DYN _DYN);
 DEFINE_PRIM(_DYN, alloc_enum_dyn, _TYPE _I32 _ARR _I32);
 DEFINE_PRIM(_ARR, enum_parameters, _DYN);
-DEFINE_PRIM(_BOOL, type_set_global, _TYPE _DYN);
+DEFINE_PRIM(_BOOL, type_set_global, _TYPE _DYN);