new container

This commit is contained in:
Daniel Kirchner
2023-01-05 13:06:14 +01:00
parent 5fd0eae74c
commit 321bef463f
9 changed files with 105 additions and 35 deletions
+12 -3
View File
@@ -78,10 +78,18 @@ public:
case uint8_t(0x00): // terminator
stop = true;
break;
case uint8_t(0x01): // code section
i += 2; // skip code size section
case uint8_t(0x01): // type section
i += 2; // skip type size section
break;
case uint8_t(0x02): // data section
case uint8_t(0x02): // code section
{
bytesRef numCodeSectionsRef(&bytecode[i + 1], 2);
size_t numCodeSections = fromBigEndian<size_t>(numCodeSectionsRef);
i += numCodeSections * 2 + 2; // skip code section header
break;
}
case uint8_t(0x03): // data section
{
auto dataSizeOffset = i + 1;
bytesRef dataSizeRef(&bytecode[dataSizeOffset], 2);
size_t dataSize = fromBigEndian<size_t>(dataSizeRef);
@@ -89,6 +97,7 @@ public:
i += 2; // skip data size section
break;
}
}
if (stop)
break;
}