git @ Cat's Eye Technologies SixtyPical / 0ca545c
Begin working out what happens when you encounter a goto. Chris Pressey 3 years ago
1 changed file(s) with 22 addition(s) and 0 deletion(s). Raw diff Collapse all Expand all
675675 self.assert_affected_within('trashes', type_, current_type)
676676
677677 context.encounter_gotos(set([instr.location]))
678
679 # now that we have encountered a goto here, we set the
680 # context here to match what someone calling the goto'ed
681 # function directly, would expect. (which makes sense
682 # when you think about it; if this goto's F, then calling
683 # this is like calling F, from the perspective of what is
684 # returned.
685
686 for ref in type_.outputs:
687 context.set_touched(ref) # ?
688 context.set_written(ref)
689
690 for ref in type_.trashes:
691 context.assert_writeable(ref)
692 context.set_touched(ref)
693 context.set_unmeaningful(ref)
694
695 # TODO is that... all we have to do? You'll note the above
696 # is a lot like call. We do rely on, if we are in a branch,
697 # the branch-merge to take care of... a lot? The fact that
698 # we don't actually continue on from here, I mean.
699
678700 elif opcode == 'trash':
679701 context.set_touched(instr.dest)
680702 context.set_unmeaningful(instr.dest)