[cfe-dev] CallEvent::isCalled() alternative if a function is called by pointer

Artem Razin via cfe-dev cfe-dev at lists.llvm.org
Wed May 2 03:58:28 PDT 2018


Hi All,

I hope this is right place to ask such a newbie question like the following.

I am trying to write a checker to catch potential handle leaks (it's on
Windows: a handle is closed by CloseHandle).

So I took SimpleStreamChecker as a base, now my checkPreCall() checks if
"CloseHandle" is called. Call.isCalled() works great except one case when
CloseHandle is called by pointer. It happens because of using a template
class that took a pointer to closing function as template parameter (useful
to close different types of handles by appropriate functions: FindClose,
CloseHandle etc.).

Call.dump() prints "&CloseHandle(this->m_h)" in this case, so it
understands that this a pointer and that this is a pointer of CloseHandle.
But how to "extract" the the identifier of CloseHandle?

Thank you in advance!

-- 
Best regards,
Artem A. Razin
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.llvm.org/pipermail/cfe-dev/attachments/20180502/0d831737/attachment.html>


More information about the cfe-dev mailing list