Closed danlarkin closed 5 years ago
This is awesome! There are a few tests in Rutie that aren't done by the docs. Could you write a test that shows it working. You don't need to prove edge cases, just that it works. I think when we get to the “new method that allows controlling it” then we can test for the edge cases. I'm in agreement with you on adding that.
rb_hash_foreach
wants a callback that returns anst_retval
.Returning
()
causes (AFAICT?) a read from uninitialized memory, which means who-knows-what happens when iterating. I wasn't able to reduce this to a repeatable test case, but I have been able to observe this happening in real code, and this commit does appear to fix it.I've hard coded a return of
st_retval::Continue
so as to not break the current API, but mayberutie::Hash
should have a new method that allows controlling it.