Skip to content

Upcast check is missing a null check when casting to a nullable type #2035

@dcodeIO

Description

@dcodeIO

Code like

class Foo {}
class Bar extends Foo {}
var foo: Foo | null = null;
foo instanceof Bar | null // here

is missing a check for when the LHS value is 0, directly calling the __instanceof helper which then can fail due to UB.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions