[Scummvm-git-logs] scummvm master -> 4c68061f072a1361174edb4b8541e883050a93ae

dwatteau noreply at scummvm.org
Fri May 16 22:24:35 UTC 2025


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

Summary:
4c68061f07 SCUMM: COMI: Fix writeVar() debug trace when _currentScript is 0xFF


Commit: 4c68061f072a1361174edb4b8541e883050a93ae
    https://github.com/scummvm/scummvm/commit/4c68061f072a1361174edb4b8541e883050a93ae
Author: Donovan Watteau (contrib at dwatteau.fr)
Date: 2025-05-17T00:23:27+02:00

Commit Message:
SCUMM: COMI: Fix writeVar() debug trace when _currentScript is 0xFF

Found by UBSan when loading some saves.

Changed paths:
    engines/scumm/script_v8.cpp


diff --git a/engines/scumm/script_v8.cpp b/engines/scumm/script_v8.cpp
index 49f7a14b2de..4335cfa1e85 100644
--- a/engines/scumm/script_v8.cpp
+++ b/engines/scumm/script_v8.cpp
@@ -313,7 +313,9 @@ void ScummEngine_v8::writeVar(uint var, int value) {
 		_scummVars[var] = value;
 
 		if ((_varwatch == (int)var) || (_varwatch == 0)) {
-			if (vm.slot[_currentScript].number < 100)
+			if (_currentScript == 0xFF)
+				debugC(DEBUG_VARS, "vars[%d] = %d", var, value);
+			else if (vm.slot[_currentScript].number < 100)
 				debugC(DEBUG_VARS, "vars[%d] = %d (via script-%d)", var, value, vm.slot[_currentScript].number);
 			else
 				debugC(DEBUG_VARS, "vars[%d] = %d (via room-%d-%d)", var, value, _currentRoom, vm.slot[_currentScript].number);




More information about the Scummvm-git-logs mailing list