Skip to content

Commit

Permalink
As support for Derefences (*v) in type inference (maybe still missing…
Browse files Browse the repository at this point in the history
… other operators like "&"
  • Loading branch information
garbervetsky committed Feb 13, 2018
1 parent fd41fb3 commit 117e051
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion Backend/Analyses/TypeInferenceAnalysis.cs
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@ public override void Visit(LoadInstruction instruction)
{
instruction.Result.Type = instruction.Operand.Type;
}

if (instruction.Operand is Dereference)
{
var deref = instruction.Operand as Dereference;
instruction.Result.Type = deref.Reference.Type;
}
}

public override void Visit(LoadTokenInstruction instruction)
Expand Down Expand Up @@ -206,7 +212,7 @@ public override void Visit(BinaryInstruction instruction)
}
}
}

#endregion

private ControlFlowGraph cfg;
Expand Down

0 comments on commit 117e051

Please sign in to comment.