pjcj / Devel--Cover

Code coverage metrics for Perl
http://www.pjcj.net/perl.html
93 stars 89 forks source link

Fix infinite-recursion with Type::Tiny / Function::Parameters #307

Closed mohawk2 closed 1 year ago

mohawk2 commented 2 years ago

Since 5b9c14aabebb324554f8281a6648161ed7dc253a, using Devel::Cover with GraphQL causes an infinite recursion. This PR fixes that by adding B::Deparse::const to the saved subs.

I suspect this is due to using Type::Tiny or Function::Parameters, but I don't know why.

Found using (after identifying that 1.36 worked fine, and the latest (1.38) didn't):

git bisect start
git bisect good v1.36
# iterating:
make; make; (cd ../graphql-perl/ && perl -Mblib=../Devel--Cover -MDevel::Cover=-db,cover_db -Mblib t/directives.t) && git bisect good || git bisect bad
zmughal commented 2 years ago

Is this related to this previous issue?: https://github.com/pjcj/Devel--Cover/issues/164#issuecomment-408230178

pjcj commented 1 year ago

Thanks for this! I have merged it with 668ba040b41bd62ecb5fb3ad83427095e2bc4fe3

@zmughal I don't think this is directly related to #164 but it's in a similar area.

mohawk2 commented 1 year ago

Suggestion: if you take someone's commit and rearrange it a bit and use it, that you do a commit --amend or rebase on that one and then cherry-pick/merge, or otherwise capture the original committer ID. Now the history reflects @pjcj fixed the issue (yes, I did note the Changes message), which isn't entirely the case.

pjcj commented 1 year ago

Oops - you're quite right. I can't remember exactly what flow I used but obviously it messed up the attribution. Sorry about that - I'll try to be more careful next time. And thanks again for the fix.