First let me say how great TPL is, I really like using it. (I wish it were easier to debug, though :-)
I have found a bug with using the following: "A(S(c#)s)". The test code crashes in tpl_free().
I tracked the problem down to a missing num multiplier in the free function. Here is the patch:
*** 1555,1561
case TPL_TYPE_UINT64:
case TPL_TYPE_INT16:
case TPL_TYPE_UINT16:
! dv = (void)((long)dv + tpl_types[c->type].sz);
break;
case TPL_TYPE_BIN:
memcpy(&binp,dv,sizeof(tpl_bin)); / cp to aligned /
--- 1555,1561 ----
case TPL_TYPE_UINT64:
case TPL_TYPE_INT16:
case TPL_TYPE_UINT16:
! dv = (void)((long)dv + tpl_types[c->type].sz * c->num);
break;
case TPL_TYPE_BIN:
memcpy(&binp,dv,sizeof(tpl_bin)); / cp to aligned /
You might want to add a test case for this one.
Best wishes!
Anonymous