Skip to content

Commit

Permalink
Fix to new mode.
Browse files Browse the repository at this point in the history
  • Loading branch information
fruffy committed Nov 23, 2023
1 parent f7ddcfe commit b95ac8b
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
3 changes: 1 addition & 2 deletions backends/p4tools/common/compiler/convert_struct_expr.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,7 @@ const IR::Node *ConvertStructExpr::postorder(IR::StructExpression *structExpr) {
resolved = true;
}
if (structType->is<IR::Type_Header>()) {
auto structExpr = expr->to<IR::StructExpression>();
return new IR::HeaderExpression(structExpr->srcInfo, structType, expr->type,
return new IR::HeaderExpression(structExpr->srcInfo, structType, structExpr->type,
structExpr->components, IR::getBoolLiteral(true));
}
if (resolved) {
Expand Down
6 changes: 4 additions & 2 deletions backends/p4tools/common/core/abstract_execution_state.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -91,9 +91,11 @@ const IR::Expression *AbstractExecutionState::convertToComplexExpression(
}
if (ts->is<IR::Type_Header>()) {
auto validity = ToolsVariables::getHeaderValidity(parent);
return new IR::HeaderExpression(ts, ts, true, components, get(validity));
// We do not know the underlying type name of the struct, so keep it anonymous.
return new IR::HeaderExpression(ts, nullptr, components, get(validity));
} else {
return new IR::StructExpression(ts, ts, true, components);
// We do not know the underlying type name of the struct, so keep it anonymous.
return new IR::StructExpression(ts, nullptr, components);
}
} else if (auto ts = parent->type->to<IR::Type_Stack>()) {
IR::Vector<IR::Expression> components;
Expand Down

0 comments on commit b95ac8b

Please sign in to comment.