Skip to content

Release HybridFunction calls dereference invalid NativeState #1561

Description

@OskarEichler

Description

HybridFunction validates the fetched/cast NativeState pointers only under NITRO_DEBUG. In release builds, calling a HybridObject method after dispose() produces a null shared pointer and then invokes the member on null. Borrowing a method onto a different HybridObject type similarly dereferences a failed dynamic cast. JSI permits a present NativeState slot whose value is null after setNativeState(nullptr).

Expected behavior

The two post-fetch pointer guards should remain active in every build, producing the existing actionable JSI errors instead of undefined behavior.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions