Skip to content

Commit

Permalink
Only process IR::Paths inside of IR::ParserState context (p4lang#4910)
Browse files Browse the repository at this point in the history
Signed-off-by: kfcripps <[email protected]>
  • Loading branch information
kfcripps authored and linuxrocks123 committed Sep 18, 2024
1 parent d95fca9 commit c81ffa2
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 c81ffa2

Please sign in to comment.