summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/tools/wasm2c-wrapper.h7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/tools/wasm2c-wrapper.h b/src/tools/wasm2c-wrapper.h
index aa36dd782..74ae21202 100644
--- a/src/tools/wasm2c-wrapper.h
+++ b/src/tools/wasm2c-wrapper.h
@@ -98,14 +98,13 @@ int main(int argc, char** argv) {
// For each export in the wasm, emit code to call it and log its result,
// similar to the other wrappers.
- size_t exportIndex = 0;
-
- for (auto& exp : wasm.exports) {
+ for (size_t i = 0; i < wasm.exports.size(); i++) {
+ auto& exp = wasm.exports[i];
if (exp->kind != ExternalKind::Function) {
continue;
}
- ret += " case " + std::to_string(exportIndex++) + ":\n";
+ ret += " case " + std::to_string(i) + ":\n";
auto* func = wasm.getFunction(exp->value);