silentbicycle / theft

property-based testing for C: generate input to find obscure bugs, then reduce to minimal failing input
ISC License
611 stars 31 forks source link

arity calculations disallow prop7 #24

Closed kquick closed 6 years ago

kquick commented 7 years ago

THEFT_MAX_ARITY is defined as 7, which is used for allocation of the type_info, but creating a prop7 property function always fails because theft_run.c:infer_arity will return 0.

The infer_arity should probably return THEFT_MAX_ARITY instead of 0 when falling out of the loop, but whether type_info should be NULL terminated, or whether there are other locations with THEFT_MAX_ARITY issues is an open question.

silentbicycle commented 7 years ago

Good find, thanks. I recently reduced the max arity to 7 (it was 10), but I've never actually had reason to use an arity higher than 2. This got missed.

silentbicycle commented 7 years ago

Fixed by a8af8fe, will be in the next release.

kquick commented 7 years ago

Excellent, thank you. It was a pretty unusual test that needed this arity level, but it is handy when you do need it.

silentbicycle commented 7 years ago

I'd love to hear more about how you're using theft! My contact info is in my profile.