Bug 1374024 - add static-analysis annotation for class functions that return dangling pointers. r=mystor

MozReview-Commit-ID: 44Ltj5FZAZD
This commit is contained in:
Tristan Bourvon 2017-07-13 12:00:06 +02:00
parent cdc988e24a
commit 3bd6c5f20a

View File

@ -109,9 +109,9 @@ public:
*/
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
char16ptr_t get() const
MOZ_NO_DANGLING_ON_TEMPORARIES char16ptr_t get() const
#else
const char_type* get() const
MOZ_NO_DANGLING_ON_TEMPORARIES const char_type* get() const
#endif
{
return mData;
@ -724,9 +724,9 @@ public:
// return nullptr if we are voided
#if defined(CharT_is_PRUnichar) && defined(MOZ_USE_CHAR16_WRAPPER)
char16ptr_t get() const
MOZ_NO_DANGLING_ON_TEMPORARIES char16ptr_t get() const
#else
const char_type* get() const
MOZ_NO_DANGLING_ON_TEMPORARIES const char_type* get() const
#endif
{
return (mDataFlags & DataFlags::VOIDED) ? nullptr : mData;