|
|
|
@ -170,14 +170,14 @@ _ (ParseType_Memory (& io_module->memoryInfo, & i_bytes, i_end));
|
|
|
|
|
case c_externalKind_global:
|
|
|
|
|
{
|
|
|
|
|
i8 waType;
|
|
|
|
|
u8 type, mut;
|
|
|
|
|
u8 type, mutable;
|
|
|
|
|
|
|
|
|
|
_ (ReadLEB_i7 (& waType, & i_bytes, i_end));
|
|
|
|
|
_ (NormalizeType (& type, waType));
|
|
|
|
|
_ (ReadLEB_u7 (& mut, & i_bytes, i_end)); m3log (parse, " global: %s mutable=%d", c_waTypes [type], (u32) mut);
|
|
|
|
|
_ (ReadLEB_u7 (& mutable, & i_bytes, i_end)); m3log (parse, " global: %s mutable=%d", c_waTypes [type], (u32) mutable);
|
|
|
|
|
|
|
|
|
|
IM3Global global;
|
|
|
|
|
_ (Module_AddGlobal (io_module, & global, type, mut, true /* isImport */));
|
|
|
|
|
_ (Module_AddGlobal (io_module, & global, type, mutable, true /* isImport */));
|
|
|
|
|
global->import = import;
|
|
|
|
|
import = clearImport;
|
|
|
|
|
}
|
|
|
|
@ -402,13 +402,14 @@ _ (ReadLEB_u32 (& numGlobals, & i_bytes, i_end));
|
|
|
|
|
for (u32 i = 0; i < numGlobals; ++i)
|
|
|
|
|
{
|
|
|
|
|
i8 waType;
|
|
|
|
|
u8 type;
|
|
|
|
|
u8 type, mutable;
|
|
|
|
|
|
|
|
|
|
_ (ReadLEB_i7 (& waType, & i_bytes, i_end));
|
|
|
|
|
_ (NormalizeType (& type, waType)); m3log (parse, " - add global: [%d] %s", i, c_waTypes [type]);
|
|
|
|
|
|
|
|
|
|
_ (NormalizeType (& type, waType));
|
|
|
|
|
_ (ReadLEB_u7 (& mutable, & i_bytes, i_end)); m3log (parse, " - add global: [%d] %s mutable: %d", i, c_waTypes [type], (u32) mutable);
|
|
|
|
|
|
|
|
|
|
IM3Global global;
|
|
|
|
|
_ (Module_AddGlobal (io_module, & global, type, false /* mutable */, false /* isImport */));
|
|
|
|
|
_ (Module_AddGlobal (io_module, & global, type, mutable, false /* isImport */));
|
|
|
|
|
|
|
|
|
|
global->initExpr = i_bytes;
|
|
|
|
|
_ (Parse_InitExpr (io_module, & i_bytes, i_end));
|
|
|
|
|