mirror of
https://github.com/catseye/SixtyPical.git
synced 2025-02-08 10:30:55 +00:00
Looks like, when we "goto", we should "pull in" the constraints.
This commit is contained in:
parent
0c481845e9
commit
27aca3dd86
@ -390,17 +390,22 @@ class Analyzer(object):
|
||||
print('-' * 79)
|
||||
print('')
|
||||
|
||||
# even if we goto another routine, we can't trash an output.
|
||||
# these all apply whether we encountered goto(s) in this routine, or not...:
|
||||
|
||||
# can't trash an output.
|
||||
for ref in trashed:
|
||||
if ref in type_.outputs:
|
||||
raise UnmeaningfulOutputError(routine, ref.name)
|
||||
|
||||
if not context.encountered_gotos():
|
||||
for ref in type_.outputs:
|
||||
context.assert_meaningful(ref, exception_class=UnmeaningfulOutputError)
|
||||
for ref in context.each_touched():
|
||||
if ref not in type_.outputs and ref not in type_.trashes and not routine_has_static(routine, ref):
|
||||
raise ForbiddenWriteError(routine, ref.name)
|
||||
# all outputs are meaningful.
|
||||
for ref in type_.outputs:
|
||||
context.assert_meaningful(ref, exception_class=UnmeaningfulOutputError)
|
||||
|
||||
# if something was touched, then it should have been declared to be writable.
|
||||
for ref in context.each_touched():
|
||||
if ref not in type_.outputs and ref not in type_.trashes and not routine_has_static(routine, ref):
|
||||
raise ForbiddenWriteError(routine, ref.name)
|
||||
|
||||
self.current_routine = None
|
||||
return context
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user