Skip to content

Resize function does not allow use of full intended memory space #11200

@bmarwritescode

Description

@bmarwritescode

Description

The resize_to_fit method may expand the memory if needed. The desired addressable space is the u32 range. Given this, it could be possible that new_size is any value in the u32 range. According to the documentation for resize(), the maximum new length is isize::MAX which for 32-bit machines it would be half of the u32 range.

Impact

This will make it so that large portions of memory are unusable on certain architectures.

Recommendation

Replace this logic with resizing logic that will work for all addresses in the expected memory address range.

AuditHub Issue Link

https://app.audithub.dev/app/organizations/161/projects/521/project-viewer?version=1201&_t=1768255975985&issueId=685

Metadata

Metadata

Assignees

Labels

brilligUnconstrained functions / brillig IR

Type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions