Validate the edges.
(self)
| 269 | self.cycles.append(cycle) |
| 270 | |
| 271 | def validate(self): |
| 272 | """Validate the edges.""" |
| 273 | |
| 274 | for function in self.functions.values(): |
| 275 | for callee_id in list(function.calls.keys()): |
| 276 | assert function.calls[callee_id].callee_id == callee_id |
| 277 | if callee_id not in self.functions: |
| 278 | sys.stderr.write('warning: call to undefined function %s from function %s\n' % (str(callee_id), function.name)) |
| 279 | del function.calls[callee_id] |
| 280 | |
| 281 | def find_cycles(self): |
| 282 | """Find cycles using Tarjan's strongly connected components algorithm.""" |