mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 521937 - Crash using js-ctypes open method with a wrong path [@PR_UnloadLibrary | mozilla::ctypes::Library::Finalize]. r=dwitte
This commit is contained in:
parent
a00ded94a8
commit
84efb8602f
@ -73,6 +73,14 @@ Library::Create(JSContext* cx, jsval aPath)
|
||||
if (!libraryObj)
|
||||
return NULL;
|
||||
|
||||
// initialize the library
|
||||
if (!JS_SetReservedSlot(cx, libraryObj, 0, PRIVATE_TO_JSVAL(NULL)))
|
||||
return NULL;
|
||||
|
||||
// initialize our Function list to empty
|
||||
if (!JS_SetReservedSlot(cx, libraryObj, 1, PRIVATE_TO_JSVAL(NULL)))
|
||||
return NULL;
|
||||
|
||||
// attach API functions
|
||||
if (!JS_DefineFunctions(cx, libraryObj, sLibraryFunctions))
|
||||
return NULL;
|
||||
@ -117,10 +125,6 @@ Library::Create(JSContext* cx, jsval aPath)
|
||||
if (!JS_SetReservedSlot(cx, libraryObj, 0, PRIVATE_TO_JSVAL(library)))
|
||||
return NULL;
|
||||
|
||||
// initialize our Function list to empty
|
||||
if (!JS_SetReservedSlot(cx, libraryObj, 1, PRIVATE_TO_JSVAL(NULL)))
|
||||
return NULL;
|
||||
|
||||
return libraryObj;
|
||||
}
|
||||
|
||||
|
@ -109,6 +109,9 @@ function run_test()
|
||||
obj.t = test_i8;
|
||||
do_check_eq(test_i8(), 123);
|
||||
do_check_eq(obj.t(), 123);
|
||||
|
||||
// bug 521937
|
||||
do_check_throws(function () { var nolib = ctypes.open("notfoundlibrary.dll"); nolib.close(); }, Error);
|
||||
}
|
||||
|
||||
function run_void_tests(library) {
|
||||
|
Loading…
Reference in New Issue
Block a user