[Scummvm-git-logs] scummvm master -> 8f53038563a7bb4c00d03fef5eae02ad3499a801
djsrv
dservilla at gmail.com
Mon Jun 29 14:40:47 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:
8f53038563 DIRECTOR: LINGO: Prevent Coverity false positives
Commit: 8f53038563a7bb4c00d03fef5eae02ad3499a801
https://github.com/scummvm/scummvm/commit/8f53038563a7bb4c00d03fef5eae02ad3499a801
Author: djsrv (dservilla at gmail.com)
Date: 2020-06-29T10:36:10-04:00
Commit Message:
DIRECTOR: LINGO: Prevent Coverity false positives
Changed paths:
engines/director/lingo/lingo.cpp
diff --git a/engines/director/lingo/lingo.cpp b/engines/director/lingo/lingo.cpp
index dcb0752422..7ea9774c63 100644
--- a/engines/director/lingo/lingo.cpp
+++ b/engines/director/lingo/lingo.cpp
@@ -94,6 +94,10 @@ Symbol& Symbol::operator=(const Symbol &s) {
void Symbol::reset() {
*refCount -= 1;
+ // Coverity thinks that we always free memory, as it assumes
+ // (correctly) that there are cases when refCount == 0
+ // Thus, DO NOT COMPILE, trick it and shut tons of false positives
+#ifndef __COVERITY__
if (*refCount <= 0) {
if (name)
delete name;
@@ -109,6 +113,7 @@ void Symbol::reset() {
delete varNames;
delete refCount;
}
+#endif
}
Symbol::~Symbol() {
@@ -691,6 +696,10 @@ void Datum::reset() {
return;
*refCount -= 1;
+ // Coverity thinks that we always free memory, as it assumes
+ // (correctly) that there are cases when refCount == 0
+ // Thus, DO NOT COMPILE, trick it and shut tons of false positives
+#ifndef __COVERITY__
if (*refCount <= 0) {
switch (type) {
case VAR:
@@ -723,7 +732,7 @@ void Datum::reset() {
}
delete refCount;
}
-
+#endif
}
Datum Datum::eval() {
More information about the Scummvm-git-logs
mailing list