Skip to content

Commit

Permalink
Fixed minor issue
Browse files Browse the repository at this point in the history
  • Loading branch information
yousifpatti committed Mar 1, 2024
1 parent f4bc39b commit 05c920c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/main/scala/analysis/UtilMethods.scala
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,8 @@ package analysis
import ir.*
import util.Logger

import scala.collection.mutable.ListBuffer

/** Evaluate an expression in a hope of finding a global variable.
*
* @param exp
Expand Down Expand Up @@ -108,8 +110,8 @@ def evaluateExpressionWithSSA(exp: Expr, constantPropResult: Map[RegisterVariabl
}
}

def unwrapExpr(expr: Expr): List[Expr] = {
val buffers = List[Expr]()
def unwrapExpr(expr: Expr): ListBuffer[Expr] = {
val buffers = ListBuffer[Expr]()
expr match {
case e: Extract => buffers ++= unwrapExpr(e.body)
case e: SignExtend => buffers ++= unwrapExpr(e.body)
Expand All @@ -120,7 +122,7 @@ def unwrapExpr(expr: Expr): List[Expr] = {
buffers ++= unwrapExpr(binaryExpr.arg1)
buffers ++= unwrapExpr(binaryExpr.arg2)
case memoryLoad: MemoryLoad =>
buffers += memoryLoad
buffers ++= ListBuffer(memoryLoad)
buffers ++= unwrapExpr(memoryLoad.index)
case _ =>
}
Expand Down

0 comments on commit 05c920c

Please sign in to comment.