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
factoryEmscriptenModule._fromJs(_EmscriptenModuleJs module) {
Object? asm = module.asm;
if (asm !=null) {
Map<int, WasmSymbol> knownAddresses = {};
_Malloc? malloc;
_Free? free;
List<WasmSymbol> exports = [];
List? entries =_entries(asm);
if (entries !=null) {
for (dynamic entry in entries) {
if (entry isList) {
Object value = entry.last;
//String type = value.runtimeType.t oString();//print(type);if (value isint) {
Global g =newGlobal(address: value, name: entry.first asString);
if (knownAddresses.containsKey(value) &&
knownAddresses[value] is!Global) {
thrownewStateError(_adu(knownAddresses[value], g));
}
knownAddresses[value] = g;
exports.add(g);
} elseif (value isFunction) {
FunctionDescription description =_fromWasmFunction(entry.first asString, value);
// It might happen that there are two different c functions that do nothing else than calling the same underlying c function// In this case, a compiler might substitute both functions with the underlying c function// So we got two functions with different names at the same table index// So it is actually ok if there are two things at the same address, as long as they are both functionsif (knownAddresses.containsKey(description.tableIndex) &&
knownAddresses[description.tableIndex]
is!FunctionDescription) {
thrownewStateError(
_adu(knownAddresses[description.tableIndex], description));
}
knownAddresses[description.tableIndex] = description;
exports.add(description);
if (description.name =='malloc') {
malloc = description.function as_Malloc;
} elseif (description.name =='free') {
free = description.function as_Free;
}
} else {
// throw new StateError(// 'Unexpected value in entry list! Entry is $entry, value is $value (of type ${value.runtimeType})');
}
} else {
thrownewStateError(
'Unexpected entry in entries(Module[\'asm\'])!');
}
}
if (malloc !=null) {
if (free !=null) {
returnnewEmscriptenModule._(module, exports, malloc, free);
} else {
thrownewStateError('Module does not export the free function!');
}
} else {
thrownewStateError('Module does not export the malloc function!');
}
} else {
thrownewStateError(
'JavaScript error: Could not access entries of Module[\'asm\']!');
}
} else {
thrownewStateError(
'Could not access Module[\'asm\'], are your sure your module was compiled using emscripten?');
}
because asm object contains WebAssembly.Memory,WebAssembly.Table which is neither int nor Functio algorithm.zip
n
The text was updated successfully, but these errors were encountered:
I build wasm use EXPORTED_FUNCTIONS option to reduce size
throw error at EmscriptenModule._fromJs
because asm object contains WebAssembly.Memory,WebAssembly.Table which is neither int nor Functio
algorithm.zip
n
The text was updated successfully, but these errors were encountered: