Skip to content

rbtree will crash node with out of memory if the comparison value is bigint #41

@thanpolas

Description

@thanpolas

Title basically, I am using native JS bigint and it crashes the node process:

const { RBTree } = require('bintrees');

const tree = new RBTree((a, b) => a - b);

tree.insert(BigInt(1));
console.log('length one:', tree.size);

// the next insert will crash node
tree.insert(BigInt(2));
console.log('length two:', tree.size);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions