bugfix hl_dyn_setp when field is not a ptr
@@ -845,7 +845,7 @@ HL_PRIM void hl_dyn_setd( vdynamic *d, int hfield, double value ) {
HL_PRIM void hl_dyn_setp( vdynamic *d, int hfield, hl_type *t, void *value ) {
hl_type *ft = NULL;
void *addr = hl_obj_lookup_set(d,hfield,t,&ft);
- if( hl_same_type(t,ft) || value == NULL )
+ if( hl_same_type(t,ft) || (hl_is_ptr(ft) && value == NULL) )
*(void**)addr = value;
else if( hl_is_dynamic(t) )
hl_write_dyn(addr,ft,(vdynamic*)value);
