Skip to content

Commit

Permalink
Only process IR::Paths inside of IR::ParserState context
Browse files Browse the repository at this point in the history
Signed-off-by: kfcripps <[email protected]>
  • Loading branch information
kfcripps committed Sep 13, 2024
1 parent 9e77cde commit fce5235
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::P4Parser>()) 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 fce5235

Please sign in to comment.