Skip to content

Commit

Permalink
Fixed indexing runtime check.
Browse files Browse the repository at this point in the history
  • Loading branch information
robby-phd committed Mar 6, 2025
1 parent 34a99a2 commit d4e0ce0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion shared/src/main/scala/org/sireum/anvil/Anvil.scala
Original file line number Diff line number Diff line change
Expand Up @@ -467,7 +467,7 @@ object Anvil {
case rhs: AST.IR.Exp.Indexing =>
val indexType = rhs.tipe.asInstanceOf[AST.Typed.Name].args(0)
val min = anvil.minIndex(indexType)
val lo = AST.IR.Exp.Int(rhs.tipe, min, pos)
val lo = AST.IR.Exp.Int(indexType, min, pos)
var hi: AST.IR.Exp = AST.IR.Exp.FieldVarRef(rhs.exp, "size", AST.Typed.z, pos)
if (min != 0) {
hi = AST.IR.Exp.Binary(AST.Typed.z, hi, AST.IR.Exp.Binary.Op.Sub, lo, pos)
Expand Down

0 comments on commit d4e0ce0

Please sign in to comment.