Always cast targetlist to const array value, so the iteration remains untouched

This commit is contained in:
smallmodel committed 2023-08-17 03:18:41 +02:00
1 parent a3c65ef7e4
commit 56fba733f3
1 file changed
+1
+1
View File
@@ -644,6 +644,7 @@ void ScriptVM::execCmdMethodCommon(op_parmNum_t param)
// because if it's a targetlist, the container object can be modified
// while iterating
ScriptVariable array = a;
array.CastConstArrayValue();
for (uintptr_t i = arraysize; i > 0; i--) {
Listener *const listener = array.listenerAt(i);