Skip to content

Commit

Permalink
BASIL-19: infinite loop detection
Browse files Browse the repository at this point in the history
  • Loading branch information
ziggyfish committed Oct 5, 2023
1 parent 92477e3 commit 4ff3b01
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions src/main/scala/analysis/NonReturningFunctions.scala
Original file line number Diff line number Diff line change
Expand Up @@ -58,8 +58,8 @@ class NonReturningFunctions {
mapJumpsToBlocks.put(directCall.target.name, mapJumpsToBlocks.getOrElse(directCall.target.name, ArrayBuffer()).addOne((directCall, block)))
case goTo: GoTo =>
mapJumpsToBlocks.put(goTo.target.label, mapJumpsToBlocks.getOrElse(goTo.target.label, ArrayBuffer()).addOne((goTo, block)))
if (isEndlessLoop(proc, goTo, index)) {

if (proc.blocks.length > index && isEndlessLoop(proc, goTo, index)) {
blocksToRemove.enqueue(proc.blocks(index+1).label)
}
case _ =>
}
Expand Down
2 changes: 1 addition & 1 deletion src/main/scala/ir/Program.scala
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class Procedure(

def calls: Set[Procedure] = blocks.flatMap(_.calls).toSet
override def toString: String = {
s"Procedure $name at ${address.getOrElse("None")} with ${blocks.size} blocks and ${in.size} in and ${out.size} out parameters")
s"Procedure $name at ${address.getOrElse("None")} with ${blocks.size} blocks and ${in.size} in and ${out.size} out parameters"
}
var modifies: mutable.Set[Global] = mutable.Set()

Expand Down

0 comments on commit 4ff3b01

Please sign in to comment.