[Analyzer] [PATCH] Adding file name to SimpleStreamChecker
adamschn at umich.edu
Mon Apr 22 12:10:01 PDT 2013
Thanks for the feedback. I think I have a better idea of how to go about it
now. I'll have another shot at it.
On Mon, Apr 22, 2013 at 1:17 PM, Anna Zaks <ganna at apple.com> wrote:
> The warning looks good for the listed test cases (though the column seems
> redundant). However, it might not be a good fit when the file name is not a
> string literal. In other checkers, we often pretty print the region
> instead; for example, see reportLeak in the MallocChecker.
> The second issue is storing the string in the state. It should be possible
> to get the file info only at the point of a leak report, not when
> processing 'fopen'. Specifically, you would go up the path when reporting
> the leak and find the statement that opened the file. That logic would be
> very similar to "getAllocationSite" from mallocChecker. Let's see if we
> can factor it out so that we do not continue with copying and pasting of
> that code.
> On Apr 21, 2013, at 10:56 PM, Adam Schnitzer <adamschn at umich.edu> wrote:
> Got it, sorry about the mixup. I will go ahead and work in
> a separate file. But did it look like I was on the right track for the
> On Mon, Apr 22, 2013 at 1:20 AM, Anna Zaks <ganna at apple.com> wrote:
>> Sorry if I was not 100% clear. We'd like to leave the
>> SimpleStreamChecker.cpp file as is for reference purposes. You can either
>> create a new file or replace StreamChecker.cpp with your checker.
>> On Apr 20, 2013, at 11:34 PM, Adam Schnitzer <adamschn at umich.edu> wrote:
>> > This is my first patch for the SimpleStreamChecker. It improves
>> diagnostics by adding the file name in the case of a resource leak. I did
>> so by adding a std::string to the StreamState to hold the file name.
>> > Any feedback would be great.
>> > Adam
>> > <SimpleStreamChecker.patch>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the cfe-commits