[Scummvm-git-logs] scummvm master -> 2165c2624485f932afa8375b165db4d8d07bfabc

sev- sev at scummvm.org
Tue Apr 28 07:25:24 UTC 2020


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .

Summary:
2165c26244 COMMON: Hide object destruction from Coverity also in U32String


Commit: 2165c2624485f932afa8375b165db4d8d07bfabc
    https://github.com/scummvm/scummvm/commit/2165c2624485f932afa8375b165db4d8d07bfabc
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-04-28T09:24:48+02:00

Commit Message:
COMMON: Hide object destruction from Coverity also in U32String

Changed paths:
    common/ustr.cpp


diff --git a/common/ustr.cpp b/common/ustr.cpp
index d68b66d05e..8064383c6e 100644
--- a/common/ustr.cpp
+++ b/common/ustr.cpp
@@ -412,7 +412,12 @@ void U32String::decRefCount(int *oldRefCount) {
 			assert(g_refCountPool);
 			g_refCountPool->freeChunk(oldRefCount);
 		}
+		// Coverity thinks that we always free memory, as it assumes
+		// (correctly) that there are cases when oldRefCount == 0
+		// Thus, DO NOT COMPILE, trick it and shut tons of false positives
+#ifndef __COVERITY__
 		delete[] _str;
+#endif
 
 		// Even though _str points to a freed memory block now,
 		// we do not change its value, because any code that calls




More information about the Scummvm-git-logs mailing list