git @ Cat's Eye Technologies SixtyPical / a53a352
Better name for this error. Chris Pressey 3 years ago
1 changed file(s) with 10 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
4242
4343
4444 class IllegalJumpError(StaticAnalysisError):
45 pass
46
47
48 class TerminatedContextError(StaticAnalysisError):
49 """What the program is doing here is not valid, due to preceding `goto`s,
50 which make this dead code."""
4551 pass
4652
4753
138144 self._touched = set(other._touched)
139145 self._range = dict(other._range)
140146 self._writeable = set(other._writeable)
147 self._terminated = other._terminated
148 self._gotos_encounters = set(other._gotos_encountered)
141149
142150 def each_meaningful(self):
143151 for ref in self._range.keys():
415423 raise InconsistentInitializationError('?')
416424 if set(ex.each_touched()) != exit_touched:
417425 raise InconsistentInitializationError('?')
426 # FIXME: confirm writeable sets are the same too?
418427 context.update_from(exit_context)
419428
420429 trashed = set(context.each_touched()) - set(context.each_meaningful())
469478 src = instr.src
470479
471480 if context.has_terminated():
472 raise IllegalJumpError(instr, instr) # TODO: maybe a better name for this
481 raise TerminatedContextError(instr, instr)
473482
474483 if opcode == 'ld':
475484 if isinstance(src, IndexedRef):