Skip to content

Commit

Permalink
Only process IR::Paths inside of IR::ParserState context (#4910)
Browse files Browse the repository at this point in the history
Signed-off-by: kfcripps <kyle@pensando.io>
  • Loading branch information
kfcripps committed Sep 17, 2024
1 parent b90f777 commit 7d54406
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions frontends/p4/moveDeclarations.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -180,6 +180,8 @@ const IR::Node *MoveInitializers::postorder(IR::ParserState *state) {
}

const IR::Node *MoveInitializers::postorder(IR::Path *path) {
if (!findContext<IR::ParserState>()) return path;

if (!oldStart || !loopsBackToStart || path->name != IR::ParserState::start) return path;

// Only rename start state references if the parser contains initializing assignments
Expand Down

0 comments on commit 7d54406

Please sign in to comment.