Skip to content

Comments

Return a slice when querying contents of a typed array#705

Open
simonwuelker wants to merge 2 commits intoservo:mainfrom
simonwuelker:typedarray-slice
Open

Return a slice when querying contents of a typed array#705
simonwuelker wants to merge 2 commits intoservo:mainfrom
simonwuelker:typedarray-slice

Conversation

@simonwuelker
Copy link
Contributor

@simonwuelker simonwuelker commented Feb 15, 2026

In rust there is no need to pass (*mut T, usize) around, as that is just a *mut [T]. This makes out-of-bounds access to typed arrays harder to do by accident.

Testing: Behaviour should be unchanged, no new tests are written
Companion PR: servo/servo#42688

This makes out-of-bounds access to typed arrays harder to do by
accident.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
Copy link
Member

@sagudev sagudev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but such change should get companion PR in servo before landing (so we do not land something that borks servo).

CI is blocked by jidicula/clang-format-action#267

@simonwuelker
Copy link
Contributor Author

LGTM, but such change should get companion PR in servo before landing (so we do not land something that borks servo).

CI is blocked by jidicula/clang-format-action#267

Servo currently depends on the crates.io version of mozjs and I think we want to keep it that way - is releasing a new version for this change okay?

This is a breaking change, but it doesn't require any changes to servo.

@sagudev
Copy link
Member

sagudev commented Feb 17, 2026

LGTM, but such change should get companion PR in servo before landing (so we do not land something that borks servo).
CI is blocked by jidicula/clang-format-action#267

Servo currently depends on the crates.io version of mozjs and I think we want to keep it that way - is releasing a new version for this change okay?

This is a breaking change, but it doesn't require any changes to servo.

Yes, that's okay.

Signed-off-by: Simon Wülker <simon.wuelker@arcor.de>
@simonwuelker
Copy link
Contributor Author

I've opened servo/servo#42688

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.

2 participants