Placate exception check validation in constructJSWebAssemblyLinkError().
authormark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 17:21:37 +0000 (17:21 +0000)
committermark.lam@apple.com <mark.lam@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 22 Mar 2019 17:21:37 +0000 (17:21 +0000)
https://bugs.webkit.org/show_bug.cgi?id=196152
<rdar://problem/49145257>

Reviewed by Michael Saboff.

JSTests:

* stress/web-assembly-link-error-exception-check.js: Added.

Source/JavaScriptCore:

* wasm/js/WebAssemblyLinkErrorConstructor.cpp:
(JSC::constructJSWebAssemblyLinkError):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@243386 268f45cc-cd09-0410-ab3c-d52691b4dbfc

JSTests/ChangeLog
JSTests/stress/web-assembly-link-error-exception-check.js [new file with mode: 0644]
Source/JavaScriptCore/ChangeLog
Source/JavaScriptCore/wasm/js/WebAssemblyLinkErrorConstructor.cpp

index b2d0701..099a21b 100644 (file)
@@ -1,3 +1,13 @@
+2019-03-22  Mark Lam  <mark.lam@apple.com>
+
+        Placate exception check validation in constructJSWebAssemblyLinkError().
+        https://bugs.webkit.org/show_bug.cgi?id=196152
+        <rdar://problem/49145257>
+
+        Reviewed by Michael Saboff.
+
+        * stress/web-assembly-link-error-exception-check.js: Added.
+
 2019-03-22  Dominik Infuehr  <dinfuehr@igalia.com>
 
         Skip tests running out of memory on ARM/MIPS
diff --git a/JSTests/stress/web-assembly-link-error-exception-check.js b/JSTests/stress/web-assembly-link-error-exception-check.js
new file mode 100644 (file)
index 0000000..8386829
--- /dev/null
@@ -0,0 +1 @@
+new WebAssembly.LinkError([]);
index 11c8ea1..4e8f6fc 100644 (file)
@@ -1,3 +1,14 @@
+2019-03-22  Mark Lam  <mark.lam@apple.com>
+
+        Placate exception check validation in constructJSWebAssemblyLinkError().
+        https://bugs.webkit.org/show_bug.cgi?id=196152
+        <rdar://problem/49145257>
+
+        Reviewed by Michael Saboff.
+
+        * wasm/js/WebAssemblyLinkErrorConstructor.cpp:
+        (JSC::constructJSWebAssemblyLinkError):
+
 2019-03-22  Timothy Hatcher  <timothy@apple.com>
 
         Change macosx() to macos() in WK_API... and JSC_API... macros.
index 3bd4a78..26202b8 100644 (file)
@@ -1,5 +1,5 @@
 /*
- * Copyright (C) 2016-2017 Apple Inc. All rights reserved.
+ * Copyright (C) 2016-2019 Apple Inc. All rights reserved.
  *
  * Redistribution and use in source and binary forms, with or without
  * modification, are permitted provided that the following conditions
@@ -51,7 +51,7 @@ static EncodedJSValue JSC_HOST_CALL constructJSWebAssemblyLinkError(ExecState* e
     JSValue message = exec->argument(0);
     auto* structure = InternalFunction::createSubclassStructure(exec, exec->newTarget(), jsCast<InternalFunction*>(exec->jsCallee())->globalObject(vm)->webAssemblyLinkErrorStructure());
     RETURN_IF_EXCEPTION(scope, encodedJSValue());
-    return JSValue::encode(JSWebAssemblyLinkError::create(exec, vm, structure, message));
+    RELEASE_AND_RETURN(scope, JSValue::encode(JSWebAssemblyLinkError::create(exec, vm, structure, message)));
 }
 
 static EncodedJSValue JSC_HOST_CALL callJSWebAssemblyLinkError(ExecState* exec)