Skip to content

Commit 726b3b5

Browse files
committed
More implicit casts plumbing
Signed-off-by: Anton Korobeynikov <anton@korobeynikov.info>
1 parent 4f1c945 commit 726b3b5

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

tools/p4mlir-translate/translate.cpp

+2-1
Original file line numberDiff line numberDiff line change
@@ -1498,8 +1498,9 @@ bool P4HIRConverter::preorder(const P4::IR::AssignmentStatement *assign) {
14981498
builder.create<P4HIR::AssignSliceOp>(loc, getValue(assign->right), ref, h, l);
14991499
} else {
15001500
auto ref = resolveReference(assign->left);
1501+
auto objectType = mlir::cast<P4HIR::ReferenceType>(ref.getType()).getObjectType();
15011502
visit(assign->right);
1502-
builder.create<P4HIR::AssignOp>(loc, getValue(assign->right), ref);
1503+
builder.create<P4HIR::AssignOp>(loc, getValue(assign->right, objectType), ref);
15031504
}
15041505

15051506
return false;

0 commit comments

Comments
 (0)