r183062 comments

Jordan Rose jordan_rose at apple.com
Fri Jun 7 11:40:35 PDT 2013


Just realized this missed the mailing list because of Unicode quotes (again). A few comments:

+  /// \param EscapingSymbol A function might not free memory in general, but

Nitpick: \param[out]


+  bool mayFreeAnyEscapedMemoryOrIsModelledExplicitely(const CallEvent *Call,
+                                   ProgramStateRef State,
+                                   SymbolRef &EscapingSymbol) const;

Typo: "explicitly". Also, while "modelled" is a valid spelling of the word, the prevailing convention in Clang seems to be "modeled". (The only other place that uses "modelled" is one of our tests.)

Double-also, since there's no way for the parameters to line up, maybe they should just be double-indented on the next line?


+bool MallocChecker::mayFreeAnyEscapedMemoryOrIsModelledExplicitely(
+                                              const CallEvent *Call,
+                                              ProgramStateRef State,
+                                              SymbolRef &EscapingSymbol) const 
   assert(Call);

We should null out EscapingSymbol at the start of the function, so the caller doesn't have to remember to. (Or we should at least assert that it's already null, so they can distinguish the possible results.)

Sorry this comes so late!
Jordan



More information about the cfe-commits mailing list