In addition to the type-checking stage which can already report some invalid jumps (when types do not match), branch-checking is used to determine that the control flow graph does not have any irregularities like "fall-through labels" (this was discussed in #12 and was one of the main problems of the current type-checker).
This PR can be merged once everything in this list has been implemented:
[x] A basic branch-checker skeleton
[x] Handling ret instructions
[x] Handling jmp instructions
[x] Handling cycles in the generated control-flow graph during branch-checking
[x] Handling call instructions
[x] Write many tests for all instructions handled here
In addition to the type-checking stage which can already report some invalid jumps (when types do not match), branch-checking is used to determine that the control flow graph does not have any irregularities like "fall-through labels" (this was discussed in #12 and was one of the main problems of the current type-checker).
This PR can be merged once everything in this list has been implemented:
ret
instructionsjmp
instructionscall
instructionsIssues to be closed: #12, #33