|
@@ -401,12 +401,12 @@ HL_PRIM bool hl_type_enum_eq( vdynamic *a, vdynamic *b ) {
|
|
return true;
|
|
return true;
|
|
}
|
|
}
|
|
|
|
|
|
-HL_PRIM vdynamic *hl_alloc_enum( hl_type *t, int index, varray *args ) {
|
|
|
|
|
|
+HL_PRIM vdynamic *hl_alloc_enum( hl_type *t, int index, varray *args, int nargs ) {
|
|
hl_enum_construct *c = t->tenum->constructs + index;
|
|
hl_enum_construct *c = t->tenum->constructs + index;
|
|
venum *e;
|
|
venum *e;
|
|
vdynamic *v;
|
|
vdynamic *v;
|
|
int i;
|
|
int i;
|
|
- if( c->nparams != args->size )
|
|
|
|
|
|
+ if( c->nparams != nargs || args->size < nargs )
|
|
return NULL;
|
|
return NULL;
|
|
e = (venum*)(c->hasptr ? hl_gc_alloc_raw(c->size) : hl_gc_alloc_noptr(c->size));
|
|
e = (venum*)(c->hasptr ? hl_gc_alloc_raw(c->size) : hl_gc_alloc_noptr(c->size));
|
|
e->index = index;
|
|
e->index = index;
|
|
@@ -436,5 +436,5 @@ DEFINE_PRIM(_TYPE, type_super, _TYPE);
|
|
DEFINE_PRIM(_DYN, type_get_global, _TYPE);
|
|
DEFINE_PRIM(_DYN, type_get_global, _TYPE);
|
|
DEFINE_PRIM(_ARR, type_enum_fields, _TYPE);
|
|
DEFINE_PRIM(_ARR, type_enum_fields, _TYPE);
|
|
DEFINE_PRIM(_BOOL, type_enum_eq, _DYN _DYN);
|
|
DEFINE_PRIM(_BOOL, type_enum_eq, _DYN _DYN);
|
|
-DEFINE_PRIM(_DYN, alloc_enum, _TYPE _I32 _ARR);
|
|
|
|
|
|
+DEFINE_PRIM(_DYN, alloc_enum, _TYPE _I32 _ARR _I32);
|
|
DEFINE_PRIM(_ARR, enum_parameters, _DYN);
|
|
DEFINE_PRIM(_ARR, enum_parameters, _DYN);
|