Loading
Bug 1743449 part 1 - Add assertion to avoid mixing UniquePtr with RefPtr. r=arai
RefPtr<CompilationStencil> would be used for caching the result of compilation which might be reused by other functions inside SpiderMonkey. However, many compilation functions are returning UniquePtr<CompilationStencil>. Converting a RefPtr<..> to a UniquePtr<..>, when the ref-count is not equal to 1, or when the value still exists in a cache will cause some UAF. This assertion prevents such mistake to happen in future patches. Differential Revision: https://phabricator.services.mozilla.com/D132694