Skip to content

Missing range check for ByteArray.setRange #1891

Closed
@sgjesse

Description

@sgjesse

Running the code

void main() {
  var src = new ByteArray(2);
  var dst = new ByteArray(2);
  dst.setRange(0, 0, src, 2);
}

on debug VM (r4668) hits an assertion:

runtime/vm/object.h:3386: error: expected: (byte_offset >= 0) && (limit <= Length())

The expected result is an IndexOutOfRange exception.

Metadata

Metadata

Assignees

No one assigned

    Labels

    P1A high priority bug; for example, a single project is unusable or has many test failuresarea-vmUse area-vm for VM related issues, including code coverage, and the AOT and JIT backends.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions