Skip to content

Value::resize does not fill the array's elements #1264

Closed
@BillyDonahue

Description

@BillyDonahue

To implement array growth, Value::resize must create new empty array elements.
It does not do this completely. It only makes the last element. The interior elements of the array are left unpopulated.

The .size() will be reported to the expected value because that only looks at the key of the final element of the map, but this is misleading because the array is sparse. The sparseness is a clever optimization but iteration over the sparse array doesn't behave as expected. The sparse elements are just skipped by the iterator sequence.

  • OS: MacOS

Discovered while investigating #1253

Metadata

Metadata

Assignees

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