Skip to content

cpp.Pointer.ofArray breaks empty Bytes comparison #1028

@Aurel300

Description

@Aurel300
var x = haxe.io.Bytes.alloc(0);
cpp.Pointer.ofArray(x.getData());
var y = haxe.io.Bytes.ofHex("");
trace(x.compare(y));

The output is 1. If the second line is removed, the output is 0 as expected. Although x.length and y.length remain at 0, in the actual Array::Memcmp implementation, length for the first argument is 1.

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