(self, other: "Stack", out: CWriter)
| 387 | self.physical_sp = other.physical_sp |
| 388 | |
| 389 | def merge(self, other: "Stack", out: CWriter) -> None: |
| 390 | if len(self.variables) != len(other.variables): |
| 391 | raise StackError("Cannot merge stacks: differing variables") |
| 392 | for self_var, other_var in zip(self.variables, other.variables): |
| 393 | if self_var.name != other_var.name: |
| 394 | raise StackError(f"Mismatched variables on stack: {self_var.name} and {other_var.name}") |
| 395 | self_var.in_local = self_var.in_local and other_var.in_local |
| 396 | if other_var.memory_offset is None: |
| 397 | self_var.memory_offset = None |
| 398 | self.align(other, out) |
| 399 | for self_var, other_var in zip(self.variables, other.variables): |
| 400 | if self_var.memory_offset is not None: |
| 401 | if self_var.memory_offset != other_var.memory_offset: |
| 402 | raise StackError(f"Mismatched stack depths for {self_var.name}: {self_var.memory_offset} and {other_var.memory_offset}") |
| 403 | elif other_var.memory_offset is None: |
| 404 | self_var.memory_offset = None |
| 405 | |
| 406 | |
| 407 | def stacks(inst: Instruction | PseudoInstruction) -> Iterator[StackEffect]: |
no test coverage detected