Skip to content

Commit 2ef44aa

Browse files
committed
[MLIR][Bytecode] Add missing field initializer in constructor initializer list
Leaving this field unitialized could led to crashes when it'll diverge from the IRNumbering phase. Differential Revision: https://reviews.llvm.org/D156965
1 parent 8a71f44 commit 2ef44aa

File tree

2 files changed

+10
-2
lines changed

2 files changed

+10
-2
lines changed

mlir/lib/Bytecode/Writer/BytecodeWriter.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -344,8 +344,8 @@ class DialectWriter : public DialectBytecodeWriter {
344344
DialectWriter(int64_t bytecodeVersion, EncodingEmitter &emitter,
345345
IRNumberingState &numberingState,
346346
StringSectionBuilder &stringSection)
347-
: emitter(emitter), numberingState(numberingState),
348-
stringSection(stringSection) {}
347+
: bytecodeVersion(bytecodeVersion), emitter(emitter),
348+
numberingState(numberingState), stringSection(stringSection) {}
349349

350350
//===--------------------------------------------------------------------===//
351351
// IR
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: mlir-opt -emit-bytecode %s | mlir-opt | FileCheck %s
2+
3+
4+
func.func @roundtripOperandSizeAttr(%arg0: i32) {
5+
// CHECK: odsOperandSegmentSizes = array<i32: 0, 2, 1, 1>}>
6+
"test.attr_sized_operands"(%arg0, %arg0, %arg0, %arg0) <{odsOperandSegmentSizes = array<i32: 0, 2, 1, 1>}> : (i32, i32, i32, i32) -> ()
7+
return
8+
}

0 commit comments

Comments
 (0)