mirror of
https://github.com/SerenityOS/serenity.git
synced 2026-11-07 04:29:30 -10: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. (cherry picked from commit 2fb3b6c542db3a86cbd1aa7e34d470e34c485372)
This commit is contained in:
1 parent
da16c169ae
commit
1c7e69a5b5
1 file changed
+5
-1
@@ -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),
|
||||
};
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
Reference in new issue
Block a user