Skip to content

Conversation

@AbnormalPoof
Copy link

@AbnormalPoof AbnormalPoof commented Nov 14, 2025

start and end would sometimes be integers, but still fall into the VariantType switch case. This would cause a memory access violation on macOS specifically!
Screenshot 2025-11-11 at 4 17 02 PM

This PR adds more strict type checking, which fixes the crash entirely.

@EliteMasterEric
Copy link
Contributor

While operating on the properties of a target component, the Actuator class will enter this block:

            var isVariant = false;
            if (start != null && Std.isOfType(start, VariantType)) {
                try { // some neko strangness here with exception being thrown on the switch
                    switch (start) {
                        case VariantType.VT_String(v):
                            start = v;
                            isVariant = true;
                        case _:
                    }
                } catch (e:Dynamic) { }
            }

In rare circumstances, the innermost block of code will be accessed, despite start not being a VT_String value or even being of the type VariantType. If it reaches this line, the expression start = v will attempt to access the value v, which does not exist, causing an access violation and immediately crashing the app without throwing a Haxe exception.

This results in the following issue, which this PR reliably resolves: FunkinCrew/Funkin#5011

In the above issue, the crash happens when target is a Tooltip, componentProperty is "opacity", and start is an integer value of 1.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants