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 469503 a4ad642832f5549367870e18b5b5f39ff36de373
parent 469502 451715b83e1c1f936e1212691939d617933d2100
child 469504 b66a064574bcc8fa3d54e4e7d0e1fef3fe681d2e
push id112801
push userccoroiu@mozilla.com
push dateMon, 15 Apr 2019 21:40:09 +0000
treeherdermozilla-inbound@afb20612c0e5 [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);