Skip to content

Array.prototype.sort crash #61404

@AserJoker

Description

@AserJoker

Version

v24.1.0

Platform

It seems to be the expected design of V8 that an OOM exception occurs when executing the statement `Array.prototype.sort.call({length: Infinity})` due to the array length issue. The program crashes. Should this be changed to gracefully exit after throwing an error?

Subsystem

No response

What steps will reproduce the bug?

execute expression Array.prototype.sort.call({length: Infinity})

How often does it reproduce? Is there a required condition?

Always

What is the expected behavior? Why is that the expected behavior?

throw a RangeError,not crash

What do you see instead?

Image

Additional information

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    v8 engineIssues and PRs related to the V8 dependency.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions