Skip to content

Commit

Permalink
Fixed Small Bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
yousifpatti committed Aug 13, 2024
1 parent 834f34e commit f607fdf
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions src/main/scala/analysis/RegionInjector.scala
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ class RegionInjector(domain: mutable.Set[CFGPosition],
case literal: Literal => literal // ignore literals
case Extract(end, start, body) =>
Extract(end, start, eval(body, cmd))
case UninterpretedFunction(name, params, returnType) =>
val newParams = params.map { p => eval(p, cmd) }
UninterpretedFunction(name, newParams, returnType)
case Repeat(repeats, body) =>
Repeat(repeats, eval(body, cmd))
case ZeroExtend(extension, body) =>
Expand All @@ -233,19 +236,19 @@ class RegionInjector(domain: mutable.Set[CFGPosition],
Logger.warn(s"Region found for mem: ${regions.head}")
regions.head match {
case stackRegion: StackRegion =>
StackMemory(stackRegion.regionIdentifier, mem.addressSize, mem.valueSize)
return StackMemory(stackRegion.regionIdentifier, mem.addressSize, mem.valueSize)
case dataRegion: DataRegion =>
SharedMemory(dataRegion.regionIdentifier, mem.addressSize, mem.valueSize)
return SharedMemory(dataRegion.regionIdentifier, mem.addressSize, mem.valueSize)
case _ =>
}
} else if (regions.size > 1) {
Logger.warn(s"Mem CMD is: ${cmd}")
Logger.warn(s"Multiple regions found for mem: ${regions}")
mmm.mergeRegions(regions) match {
case stackRegion: StackRegion =>
StackMemory(stackRegion.regionIdentifier, mem.addressSize, mem.valueSize)
return StackMemory(stackRegion.regionIdentifier, mem.addressSize, mem.valueSize)
case dataRegion: DataRegion =>
SharedMemory(dataRegion.regionIdentifier, mem.addressSize, mem.valueSize)
return SharedMemory(dataRegion.regionIdentifier, mem.addressSize, mem.valueSize)
case _ =>
}
} else {
Expand Down Expand Up @@ -293,7 +296,7 @@ class RegionInjector(domain: mutable.Set[CFGPosition],
newArrayBuffer += mem
Logger.warn(s"No region found for memory section ${mem.address}")
}
case _ =>
case null =>
}
}
newArrayBuffer
Expand Down

0 comments on commit f607fdf

Please sign in to comment.