Commit b60e0dcb authored by Richard Angersbach's avatar Richard Angersbach
Browse files

Fix component accesses in IR_AccessFieldFunction.

parent 42dc9f8c
...@@ -17,7 +17,10 @@ abstract class IR_AccessFunction extends IR_Node { ...@@ -17,7 +17,10 @@ abstract class IR_AccessFunction extends IR_Node {
case class IR_AccessFieldFunction(var field : IR_Field, var slot : IR_Expression, var hodtComponentIndex : Option[IR_Index] = None) extends IR_AccessFunction { case class IR_AccessFieldFunction(var field : IR_Field, var slot : IR_Expression, var hodtComponentIndex : Option[IR_Index] = None) extends IR_AccessFunction {
override def get(idx : IR_Index) : IR_Access = { override def get(idx : IR_Index) : IR_Access = {
val index = if (hodtComponentIndex.isDefined) idx + hodtComponentIndex.get else idx val index = if (hodtComponentIndex.isDefined)
IR_ExpressionIndex(idx.toExpressionIndex.indices ++ hodtComponentIndex.get.toExpressionIndex.indices)
else
idx
IR_FieldAccess(field, slot, index.toExpressionIndex) IR_FieldAccess(field, slot, index.toExpressionIndex)
} }
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment