mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-25 00:50:22 +00:00
LibJS: Make ConservativeVector<T> visit all possible values
We were miscalculating the length of the buffer in pointer-sized chunks, which is what the conservative root scan cares about. This could cause some values to be prematurely garbage-collected.
This commit is contained in:
parent
faf6fd1189
commit
2fb3b6c542
Notes:
github-actions[bot]
2024-11-12 16:39:36 +00:00
Author: https://github.com/awesomekling Commit: https://github.com/LadybirdBrowser/ladybird/commit/2fb3b6c542d Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2301 Reviewed-by: https://github.com/Hendiadyoin1
1 changed files with 5 additions and 1 deletions
|
@ -66,7 +66,11 @@ public:
|
|||
|
||||
virtual ReadonlySpan<FlatPtr> possible_values() const override
|
||||
{
|
||||
return ReadonlySpan<FlatPtr> { reinterpret_cast<FlatPtr const*>(this->data()), this->size() };
|
||||
static_assert(sizeof(T) >= sizeof(FlatPtr));
|
||||
return ReadonlySpan<FlatPtr> {
|
||||
reinterpret_cast<FlatPtr const*>(this->data()),
|
||||
this->size() * sizeof(T) / sizeof(FlatPtr),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
|
Loading…
Reference in a new issue