From 145fe29dbe65b374c5cd428c95c5040fc6bb3aa9 Mon Sep 17 00:00:00 2001 From: Tristan Bourvon Date: Thu, 6 Jul 2017 14:29:07 +0200 Subject: [PATCH] Bug 1374024 - add static-analysis annotation for methods that return dangling pointers. r=mystor MozReview-Commit-ID: KE4a4W0Du3I --- xpcom/string/nsTString.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/xpcom/string/nsTString.h b/xpcom/string/nsTString.h index a2e62937a4c1..542f7d552a64 100644 --- a/xpcom/string/nsTString.h +++ b/xpcom/string/nsTString.h @@ -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; @@ -732,9 +732,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;