This is an archive of the discontinued LLVM Phabricator instance.

[libFuzzer] Diff 10 - Improve fread error handling.
AbandonedPublic

Authored by mpividori on Nov 30 2016, 3:31 PM.

Details

Reviewers
kcc
zturner

Diff Detail

Repository
rL LLVM

Event Timeline

mpividori updated this revision to Diff 79828.Nov 30 2016, 3:31 PM
mpividori retitled this revision from to [libFuzzer] Diff 10 - Improve fread error handling..
mpividori updated this object.
mpividori added reviewers: kcc, zturner.
mpividori set the repository for this revision to rL LLVM.
mpividori added a subscriber: llvm-commits.
kcc edited edge metadata.Nov 30 2016, 4:29 PM

Are you solving an actual problem or a hypothetical?

@kcc this changes where suggested by @zturner . hypothetical problem.

kcc added a comment.Nov 30 2016, 4:43 PM

I'd like to avoid fixes that increase the code size and fix no observable problem.

@kcc this changes add a check for ferror() . Previous implementation doesn't check for that possible error.

kcc added a comment.Nov 30 2016, 4:52 PM

And I wouldn't care about it, unless you want to add a test.

@kcc So, if fread() fails, previous implementation will return true. Do you think that is ok?

kcc added a comment.Nov 30 2016, 5:06 PM

I don't mind. Nothing in the following workflow will change its behavior.

@kcc Thanks for your comments. But don't you think this would be better for future uses of ExecuteCommandAndReadOutput() ? To return false if fread fails?

kcc added a comment.Nov 30 2016, 5:11 PM

ain't broke don't fix it

Also, if you can't prepare a test for a fix (or don't have time for a test), the fix may not be worth it.
(This is not always true, but frequently).

mpividori abandoned this revision.Nov 30 2016, 5:30 PM