You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
$ bin/wasm-split a.wat -all --split -o1 a.wasm -o2 b.wasm -S --split-funcs=0
warning: not keeping any functions in the primary module
wasm-split: src/support/name.cpp:44: std::ostream& wasm::Name::print(std::ostream&) const: Assertion `*this && "Cannot print an empty name"' failed.
Aborted
It seems to have a null Name for the table when it creates a CallIndirect. At a glance at the code I thought this might work:
diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp
index e0fba8ae8..31b85b906 100644
--- a/src/ir/module-splitting.cpp+++ b/src/ir/module-splitting.cpp@@ -158,6 +158,10 @@ TableSlotManager::TableSlotManager(Module& module) : module(module) {
}
activeTable = it->get();
+ if (activeTable == nullptr) {+ activeTable = makeTable();+ activeBase = {activeTable->name, "", 0};+ }
ModuleUtils::iterTableSegments(
module, activeTable->name, [&](ElementSegment* segment) {
activeTableSegments.push_back(segment);
@@ -220,11 +227,6 @@ TableSlotManager::Slot TableSlotManager::getSlot(Name func, HeapType type) {
// If there are no segments yet, allocate one.
if (activeSegment == nullptr) {
- if (activeTable == nullptr) {- activeTable = makeTable();- activeBase = {activeTable->name, "", 0};- }-
// None of the existing segments should refer to the active table
assert(std::all_of(module.elementSegments.begin(),
module.elementSegments.end(),
That fixes this one but other testcases start to fail so I am not sure if I understand what "active base/table/segment" mean here - some seem to need to be set in the constructor but others not? Anyhow this might be something trivial I am missing, @tlively
The text was updated successfully, but these errors were encountered:
The module splitting code incorrectly assumed that there would be at least one
active element segment and failed to initialize the table slot manager with a
function table if that was not the case. Fix the bug by setting the table even
when there are no active segments and add a test.
Fixes#6572.
The module splitting code incorrectly assumed that there would be at least one
active element segment and failed to initialize the table slot manager with a
function table if that was not the case. Fix the bug by setting the table even
when there are no active segments and add a test.
Fixes#6572 and #6637.
It seems to have a null Name for the table when it creates a CallIndirect. At a glance at the code I thought this might work:
That fixes this one but other testcases start to fail so I am not sure if I understand what "active base/table/segment" mean here - some seem to need to be set in the constructor but others not? Anyhow this might be something trivial I am missing, @tlively
The text was updated successfully, but these errors were encountered: