summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-stack.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-stack.cpp')
-rw-r--r--src/wasm/wasm-stack.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/wasm/wasm-stack.cpp b/src/wasm/wasm-stack.cpp
index e64e330e8..eedac4e95 100644
--- a/src/wasm/wasm-stack.cpp
+++ b/src/wasm/wasm-stack.cpp
@@ -1808,7 +1808,7 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() {
return;
}
for (auto type : func->vars) {
- for (auto& t : type) {
+ for (const auto& t : type) {
numLocalsByType[t]++;
}
}
@@ -1816,7 +1816,7 @@ void BinaryInstWriter::mapLocalsAndEmitHeader() {
std::map<Type, size_t> currLocalsByType;
for (Index i = func->getVarIndexBase(); i < func->getNumLocals(); i++) {
Index j = 0;
- for (auto& type : func->getLocalType(i)) {
+ for (const auto& type : func->getLocalType(i)) {
auto fullIndex = std::make_pair(i, j++);
Index index = func->getVarIndexBase();
for (auto& typeCount : numLocalsByType) {