diff options
author | Thomas Lively <tlively123@gmail.com> | 2024-12-06 12:21:15 -0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-06 20:21:15 +0000 |
commit | 3f82ffc70362bf967d91d3cb56ee4c8c5ebe1161 (patch) | |
tree | 9dce8bbf9858fc646603470da05f2a45000da613 | |
parent | 06e06ec86f7d1e91d0fa9e53cf8bb13d0e3e0df4 (diff) | |
download | binaryen-3f82ffc70362bf967d91d3cb56ee4c8c5ebe1161.tar.gz binaryen-3f82ffc70362bf967d91d3cb56ee4c8c5ebe1161.tar.bz2 binaryen-3f82ffc70362bf967d91d3cb56ee4c8c5ebe1161.zip |
Remove incorrect warning when reading name section (#7140)
When we refactored how the name section is read, we accidentally left an
old warning about invalid field name indices in place. The old warning
code compares the type index from the names section to the size of the
parsed type vector to determine if the index is out-of-bounds. Now that
we parse the name section before the type section, this is no longer
correct. Delete the old warning; we already have a new, correct warning
for out-of-bound indices when we parse the type section.
-rw-r--r-- | src/wasm/wasm-binary.cpp | 5 |
1 files changed, 0 insertions, 5 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index 86b3ea899..f710c8bc1 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -4730,11 +4730,6 @@ void WasmBinaryReader::findAndReadNames() { auto numTypes = getU32LEB(); for (size_t i = 0; i < numTypes; i++) { auto typeIndex = getU32LEB(); - bool validType = - typeIndex < types.size() && types[typeIndex].isStruct(); - if (!validType) { - std::cerr << "warning: invalid field index in name field section\n"; - } auto numFields = getU32LEB(); NameProcessor processor; for (size_t i = 0; i < numFields; i++) { |