From f607fdf336a04c0bec8d7c6c46460c3223ecc166 Mon Sep 17 00:00:00 2001 From: yousifpatti Date: Tue, 13 Aug 2024 16:10:07 +1000 Subject: [PATCH] Fixed Small Bugs --- src/main/scala/analysis/RegionInjector.scala | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/main/scala/analysis/RegionInjector.scala b/src/main/scala/analysis/RegionInjector.scala index 1d6ad0781..2b227b415 100644 --- a/src/main/scala/analysis/RegionInjector.scala +++ b/src/main/scala/analysis/RegionInjector.scala @@ -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) => @@ -233,9 +236,9 @@ 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) { @@ -243,9 +246,9 @@ class RegionInjector(domain: mutable.Set[CFGPosition], 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 { @@ -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