[WebAssembly] Fix bad assertion in LLIntPlan
https://bugs.webkit.org/show_bug.cgi?id=204893
Reviewed by Mark Lam.
Before landing r253140 I introduced an assertion in Wasm::LLIntPlan that the pointer to previously
compiled callees must be non-null. However, it's perfectly valid for the pointer to be null when the
module has no functions.
* wasm/WasmLLIntPlan.cpp:
(JSC::Wasm::LLIntPlan::LLIntPlan):
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@253168 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/JavaScriptCore/ChangeLog b/Source/JavaScriptCore/ChangeLog
index 688c497..316c107 100644
--- a/Source/JavaScriptCore/ChangeLog
+++ b/Source/JavaScriptCore/ChangeLog
@@ -1,3 +1,17 @@
+2019-12-05 Tadeu Zagallo <tzagallo@apple.com>
+
+ [WebAssembly] Fix bad assertion in LLIntPlan
+ https://bugs.webkit.org/show_bug.cgi?id=204893
+
+ Reviewed by Mark Lam.
+
+ Before landing r253140 I introduced an assertion in Wasm::LLIntPlan that the pointer to previously
+ compiled callees must be non-null. However, it's perfectly valid for the pointer to be null when the
+ module has no functions.
+
+ * wasm/WasmLLIntPlan.cpp:
+ (JSC::Wasm::LLIntPlan::LLIntPlan):
+
2019-12-05 Mark Lam <mark.lam@apple.com>
computeIfUsingFuzzerAgent() is called before parsing command line arguments.
diff --git a/Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp b/Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
index cae57ed..337fec3 100644
--- a/Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
+++ b/Source/JavaScriptCore/wasm/WasmLLIntPlan.cpp
@@ -56,7 +56,7 @@
: Base(context, WTFMove(info), AsyncWork::FullCompile, WTFMove(task))
, m_callees(callees)
{
- ASSERT(m_callees);
+ ASSERT(m_callees || !m_moduleInformation->functions.size());
prepare();
m_currentIndex = m_moduleInformation->functions.size();
}