Bug 142224 - BitStack::top() should calculate an index instead of always using m_words.last()
Summary: BitStack::top() should calculate an index instead of always using m_words.last()
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified All
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-03-03 10:24 PST by W. James MacLean
Modified: 2022-12-21 07:08 PST (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 W. James MacLean 2015-03-03 10:24:44 PST
BitStack::push() calculates an index based on m_size to determine where the new entry is supposed to go.

However, BitStack::top() always looks up the bit value using m_words.last(), which can be wrong if popping elements has caused m_size to point into a word other than the last one (simple test: push 'true' 33 times, then pop() once and call top() ... it will read 'false'.)

BitStack::top() should instead calculate an index the same as push().
Comment 1 EWS 2022-12-21 07:07:02 PST
Committed 258190@main (409456bc5cee): <https://commits.webkit.org/258190@main>

Reviewed commits have been landed. Closing PR #7888 and removing active labels.
Comment 2 Radar WebKit Bug Importer 2022-12-21 07:08:16 PST
<rdar://problem/103597584>