Bug 262431

Summary: [Hardening] Make Vector::uncheckedAppend() an alias to Vector::append()
Product: WebKit Reporter: Chris Dumez <cdumez>
Component: Web Template FrameworkAssignee: Chris Dumez <cdumez>
Status: RESOLVED FIXED    
Severity: Normal CC: webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

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>