allocate a GC root value for the Value cache pointer
keeping it as a simple data member means it won't be scanned by the GC, so eventually the GC will collect a cache that is still referenced (resulting in use-after-free of cache elements). fixes #5962
This commit is contained in:
+1
-1
@@ -133,7 +133,7 @@ private:
|
||||
std::shared_ptr<RegexCache> regexCache;
|
||||
|
||||
/* Allocation cache for GC'd Value objects. */
|
||||
void * valueAllocCache = nullptr;
|
||||
std::shared_ptr<void *> valueAllocCache;
|
||||
|
||||
public:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user