[llvm] [llvm-readobj][COFF] Dump .modmeta section (PR #201695)

James Henderson via llvm-commits llvm-commits at lists.llvm.org
Thu Jun 11 02:33:15 PDT 2026


================
@@ -22,99 +21,95 @@ bool COFFCxxModuleMetadataReader::hasModuleData() const {
 }
 
 Expected<uint32_t> COFFCxxModuleMetadataReader::readModuleID() {
+  if (ModuleIndexWidth != 1 && ModuleIndexWidth != 2 && ModuleIndexWidth != 4)
+    return createStringError("unsupported index width: %d", ModuleIndexWidth);
+
+  if (ModuleData.size() < ModuleIndexWidth)
+    return createStringError("not enough data");
----------------
jh7370 wrote:

I'd include the `ModuleData` and `ModuleIndexWidth` in the error message.

https://github.com/llvm/llvm-project/pull/201695


More information about the llvm-commits mailing list