Skip to content

Commit

Permalink
Call findAssignmentConstDiff on loops body instead the loop itself
Browse files Browse the repository at this point in the history
  • Loading branch information
karoliineh committed Sep 28, 2024
1 parent e77b41c commit da52931
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/util/loopUnrolling.ml
Original file line number Diff line number Diff line change
Expand Up @@ -262,7 +262,7 @@ let fixedLoopSize loopStatement func =
in let assignmentDifference loop var = try
let diff = ref None in
let visitor = new findAssignmentConstDiff(diff, var) in
ignore @@ visitCilStmt visitor loop;
ignore @@ visitCilBlock visitor loop;
!diff
with | WrongOrMultiple -> None
in
Expand All @@ -273,7 +273,7 @@ let fixedLoopSize loopStatement func =
None
else
constBefore var loopStatement func >>= fun start ->
assignmentDifference loopStatement var >>= fun diff ->
assignmentDifference (loopBody loopStatement) var >>= fun diff ->
Logs.debug "comparison: ";
Pretty.fprint stderr (dn_exp () comparison) ~width:max_int;
Logs.debug "";
Expand Down

0 comments on commit da52931

Please sign in to comment.