[Mlir-commits] [mlir] [MLIR][Bytecode] Enforce alignment requirements (PR #157004)

Nikhil Kalra llvmlistbot at llvm.org
Mon Sep 8 11:23:31 PDT 2025


================
@@ -2121,6 +2180,11 @@ BytecodeReader::Impl::parseIRSection(ArrayRef<uint8_t> sectionData,
 LogicalResult
 BytecodeReader::Impl::parseRegions(std::vector<RegionReadState> &regionStack,
                                    RegionReadState &readState) {
+  const auto checkSectionAlignment = [&](unsigned alignment) {
+    return this->checkSectionAlignment(
+        alignment, [&](const auto &msg) { return emitError(fileLoc, msg); });
----------------
nikalra wrote:

It tries to use `EncodingReader::emitError` where available in case the Location information there is more accurate.

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


More information about the Mlir-commits mailing list