Bug 1209933 - Make sure all parent runtime pointers are the topmost parent, r=billm.

This commit is contained in:
Brian Hackett 2015-10-01 14:36:06 -06:00
Родитель a5f3043e0f
Коммит 3b509ae190
1 изменённых файлов: 3 добавлений и 5 удалений

Просмотреть файл

@ -668,11 +668,9 @@ JS_NewRuntime(uint32_t maxbytes, uint32_t maxNurseryBytes, JSRuntime* parentRunt
MOZ_ASSERT(jsInitState == Running,
"must call JS_Init prior to creating any JSRuntimes");
// Any parent runtime should be the topmost parent. This assert
// isn't required for correctness, but ensuring that the parent
// runtime is not destroyed before this one is more easily done
// for the main runtime in the process.
MOZ_ASSERT_IF(parentRuntime, !parentRuntime->parentRuntime);
// Make sure that all parent runtimes are the topmost parent.
while (parentRuntime && parentRuntime->parentRuntime)
parentRuntime = parentRuntime->parentRuntime;
JSRuntime* rt = js_new<JSRuntime>(parentRuntime);
if (!rt)