[Scummvm-git-logs] scummvm master -> 841b125cf13cb85272919bc13924fbe779ad5402

sev- sev at scummvm.org
Mon Jan 20 17:38:19 UTC 2020


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

Summary:
fa9d525b8f CONFIGURE: Added option for enabling clang Address Sanitizer
841b125cf1 DIRECTOR: Added sanity check to score parsing


Commit: fa9d525b8f346f058f24d7209c7ddeb97ff16282
    https://github.com/scummvm/scummvm/commit/fa9d525b8f346f058f24d7209c7ddeb97ff16282
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-20T18:37:23+01:00

Commit Message:
CONFIGURE: Added option for enabling clang Address Sanitizer

Changed paths:
    configure


diff --git a/configure b/configure
index 2aea6cd..2bd2c13 100755
--- a/configure
+++ b/configure
@@ -179,6 +179,7 @@ _lua=yes
 _build_scalers=yes
 _build_hq_scalers=yes
 _enable_prof=no
+_enable_asan=no
 _global_constructors=no
 _no_undefined_var_template=no
 _no_pragma_pack=no
@@ -1430,6 +1431,9 @@ for ac_option in $@; do
 	--enable-profiling)
 		_enable_prof=yes
 		;;
+	--enable-asan)
+		_enable_asan=yes
+		;;
 	--with-sdl-prefix=*)
 		arg=`echo $ac_option | cut -d '=' -f 2`
 		_sdlpath="$arg:$arg/bin"
@@ -5614,6 +5618,18 @@ if test "$_enable_prof" = yes ; then
 	append_var DEFINES "-DENABLE_PROFILING"
 fi
 
+echo_n "Enabling Address Sanitizer... "
+
+if test "$_enable_asan" = yes ; then
+	if test "$have_clang" = yes ; then
+		append_var CXXFLAGS "-fsanitize=address -fno-omit-frame-pointer"
+		append_var LDFLAGS "-fsanitize=address -fno-omit-frame-pointer"
+	else
+		_enable_asan="disabled, clang-only"
+	fi
+fi
+echo "$_enable_asan"
+
 echo_n "Backend... "
 echo_n "$_backend"
 


Commit: 841b125cf13cb85272919bc13924fbe779ad5402
    https://github.com/scummvm/scummvm/commit/841b125cf13cb85272919bc13924fbe779ad5402
Author: Eugene Sandulenko (sev at scummvm.org)
Date: 2020-01-20T18:37:46+01:00

Commit Message:
DIRECTOR: Added sanity check to score parsing

Changed paths:
    engines/director/score.cpp


diff --git a/engines/director/score.cpp b/engines/director/score.cpp
index d588f79..6a64ef1 100644
--- a/engines/director/score.cpp
+++ b/engines/director/score.cpp
@@ -812,11 +812,15 @@ void Score::loadCastData(Common::SeekableSubReadStreamEndian &stream, uint16 id,
 			}
 		} else {
 			if (!ci->script.empty()) {
-				// the script type here could be wrong!
-				if (ConfMan.getBool("dump_scripts"))
-					dumpScript(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
+				if (_loadedCast->getVal(id)->_type == kCastLingoScript) {
+					// the script type here could be wrong!
+					if (ConfMan.getBool("dump_scripts"))
+						dumpScript(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
 
-				_lingo->addCode(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
+					_lingo->addCode(ci->script.c_str(), ((ScriptCast *)_loadedCast->getVal(id))->_scriptType, id);
+				} else {
+					warning("Score::loadCastData(): Wrong cast type: %d", _loadedCast->getVal(id)->_type);
+				}
 			}
 		}
 




More information about the Scummvm-git-logs mailing list