Bug 262431 - [Hardening] Make Vector::uncheckedAppend() an alias to Vector::append()
Summary: [Hardening] Make Vector::uncheckedAppend() an alias to Vector::append()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Template Framework (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Chris Dumez
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-09-29 21:47 PDT by Chris Dumez
Modified: 2023-09-30 22:00 PDT (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Chris Dumez 2023-09-29 21:47:18 PDT
Make Vector::uncheckedAppend() an alias to Vector::append() so that bounds checking happens. This is part of our effort to make our code safer.

This tested as performance neutral on Speedometer, MotionMark and JetStream on various A/B bots. However, I plan to monitor the bots after landing to be safe. If it sticks, I'll follow-up to get rid of Vector::uncheckedAppend() completely.

Note that in order to maintain the performance, WTF::map(), Vector::map(), copyToVector() & copyToVectorOf() still rely on a private unsafeAppendWithoutCapacityCheck() function.
Comment 1 Chris Dumez 2023-09-29 21:52:28 PDT
Pull request: https://github.com/WebKit/WebKit/pull/18458
Comment 2 EWS 2023-09-30 21:59:53 PDT
Committed 268700@main (1b624bea4bbb): <https://commits.webkit.org/268700@main>

Reviewed commits have been landed. Closing PR #18458 and removing active labels.
Comment 3 Radar WebKit Bug Importer 2023-09-30 22:00:15 PDT
<rdar://problem/116299437>