Bug 1544383 - Fix WebAssembly class init in fuzzing target. r=bbouvier
authorChristian Holler <choller@mozilla.com>
Mon, 15 Apr 2019 12:24:50 +0000
changeset 469491 a4ad642832f5
parent 469490 451715b83e1c
child 469492 b66a064574bc
push id35873
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:36:26 +0000
treeherdermozilla-central@b8f49a14c458 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbbouvier
bugs1544383
milestone68.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1544383 - Fix WebAssembly class init in fuzzing target. r=bbouvier Differential Revision: https://phabricator.services.mozilla.com/D27486
js/src/fuzz-tests/testWasm.cpp
--- a/js/src/fuzz-tests/testWasm.cpp
+++ b/js/src/fuzz-tests/testWasm.cpp
@@ -22,17 +22,17 @@
 using namespace js;
 using namespace js::wasm;
 
 // These are defined and pre-initialized by the harness (in tests.cpp).
 extern JS::PersistentRootedObject gGlobal;
 extern JSContext* gCx;
 
 static int testWasmInit(int* argc, char*** argv) {
-  if (!wasm::HasSupport(gCx)) {
+  if (!wasm::HasSupport(gCx) || !InitWebAssemblyClass(gCx, gCx->global())) {
     MOZ_CRASH("Failed to initialize wasm support");
   }
 
   return 0;
 }
 
 static bool emptyNativeFunction(JSContext* cx, unsigned argc, Value* vp) {
   CallArgs args = CallArgsFromVp(argc, vp);