Helper function to encode an unsigned 32-bit integer as LEB128
| 41 | |
| 42 | // Helper function to encode an unsigned 32-bit integer as LEB128 |
| 43 | static std::vector<WasmEdge::Byte> encodeLEB128(uint32_t Value) { |
| 44 | std::vector<WasmEdge::Byte> Leb; |
| 45 | do { |
| 46 | WasmEdge::Byte Byte = Value & 0x7FU; |
| 47 | Value >>= 7; |
| 48 | if (Value != 0) { |
| 49 | Byte |= 0x80U; |
| 50 | } |
| 51 | Leb.push_back(Byte); |
| 52 | } while (Value != 0); |
| 53 | return Leb; |
| 54 | } |
| 55 | |
| 56 | // Generates a Wasm module with a chain of subtypes. |
| 57 | // NumTotalTypes: The total number of types to define. Type k+1 subtypes type |
no outgoing calls
no test coverage detected