[Scummvm-git-logs] scummvm master -> 77309013bd246f28ee694a674ecf79406ac6a861

criezy noreply at scummvm.org
Wed May 17 20:34:20 UTC 2023


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:
77309013bd AGS: Fixed std::function bool cast


Commit: 77309013bd246f28ee694a674ecf79406ac6a861
    https://github.com/scummvm/scummvm/commit/77309013bd246f28ee694a674ecf79406ac6a861
Author: Wyatt Radkiewicz (35124673+wyatt-radkiewicz at users.noreply.github.com)
Date: 2023-05-17T21:34:15+01:00

Commit Message:
AGS: Fixed std::function bool cast

The behaviour of casting the std::function struct to bool was wrong on
Apple Silicon with clang and optimisations enabled and returned true
if _fn was nullptr. This lead to a crash with AGS games.

Changed paths:
    engines/ags/lib/std/functional.h


diff --git a/engines/ags/lib/std/functional.h b/engines/ags/lib/std/functional.h
index 5cd7a66343f..ece633814bc 100644
--- a/engines/ags/lib/std/functional.h
+++ b/engines/ags/lib/std/functional.h
@@ -48,6 +48,10 @@ struct function {
 	operator _Fty &() {
 		return *_fn;
 	}
+
+	operator bool() const {
+		return _fn != nullptr;
+	}
 };
 
 } // namespace std




More information about the Scummvm-git-logs mailing list