Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor fix for Allocator.remap and mem.bytesAsSlice for zero-sized types #23220

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

samy-00007
Copy link
Contributor

This PR does 3 things:

  • for Allocator.remap, if the type is zero-sized, then it only changes the slice's length
  • for mem.bytesAsSlice, if the type is zero-sized, it returns a slice with a length of zero (instead of crashing because of a division by zero)
  • added a test for the 2 first points and one for json parsing with zero-sized types

Fixes #23168

@alexrp alexrp added this to the 0.14.1 milestone Mar 13, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

std.json.parseFromSlice divide by zero
3 participants