Skip to content

Commit 117e051

Browse files
committed
As support for Derefences (*v) in type inference (maybe still missing other operators like "&"
1 parent fd41fb3 commit 117e051

1 file changed

Lines changed: 7 additions & 1 deletion

File tree

Backend/Analyses/TypeInferenceAnalysis.cs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,6 +114,12 @@ public override void Visit(LoadInstruction instruction)
114114
{
115115
instruction.Result.Type = instruction.Operand.Type;
116116
}
117+
118+
if (instruction.Operand is Dereference)
119+
{
120+
var deref = instruction.Operand as Dereference;
121+
instruction.Result.Type = deref.Reference.Type;
122+
}
117123
}
118124

119125
public override void Visit(LoadTokenInstruction instruction)
@@ -206,7 +212,7 @@ public override void Visit(BinaryInstruction instruction)
206212
}
207213
}
208214
}
209-
215+
210216
#endregion
211217

212218
private ControlFlowGraph cfg;

0 commit comments

Comments
 (0)