diff options
author | Derek Schuff <dschuff@chromium.org> | 2022-06-06 15:42:24 -0700 |
---|---|---|
committer | Derek Schuff <dschuff@chromium.org> | 2022-06-07 12:05:23 -0700 |
commit | 2ae385e560a62a18942cbc202cd19313c6c59470 (patch) | |
tree | be8d9f8b3542cb36b722a20ffca98446ae3a55d2 /llvm/lib/Object/WasmObjectFile.cpp | |
parent | b6553f592aa4227f73d31f656bf84c9b722ea4cd (diff) | |
download | llvm-2ae385e560a62a18942cbc202cd19313c6c59470.zip llvm-2ae385e560a62a18942cbc202cd19313c6c59470.tar.gz llvm-2ae385e560a62a18942cbc202cd19313c6c59470.tar.bz2 |
[WebAssembly] Add WASM_SEC_LAST_KNOWN to BinaryFormat section types list [NFC]
There are 3 places where we were using WASM_SEC_TAG as the "last" known
section type, which requires updating (or leaves a bug) when a new known
section type is added. Instead add a "last type" to the enum for this
purpose.
Differential Revision: https://reviews.llvm.org/D127164
Diffstat (limited to 'llvm/lib/Object/WasmObjectFile.cpp')
-rw-r--r-- | llvm/lib/Object/WasmObjectFile.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/llvm/lib/Object/WasmObjectFile.cpp b/llvm/lib/Object/WasmObjectFile.cpp index 73c2f86..0e99c21 100644 --- a/llvm/lib/Object/WasmObjectFile.cpp +++ b/llvm/lib/Object/WasmObjectFile.cpp @@ -1729,7 +1729,7 @@ Expected<StringRef> WasmObjectFile::getSectionName(DataRefImpl Sec) const { const WasmSection &S = Sections[Sec.d.a]; if (S.Type == wasm::WASM_SEC_CUSTOM) return S.Name; - if (S.Type > wasm::WASM_SEC_TAG) + if (S.Type > wasm::WASM_SEC_LAST_KNOWN) return createStringError(object_error::invalid_section_index, ""); return wasm::sectionTypeToString(S.Type); } |