MCPcopy Index your code
hub / github.com/python/cpython / align

Method align

Tools/cases_generator/stack.py:379–387  ·  view source on GitHub ↗
(self, other: "Stack", out: CWriter)

Source from the content-addressed store, hash-verified

377 )
378
379 def align(self, other: "Stack", out: CWriter) -> None:
380 if self.logical_sp != other.logical_sp:
381 raise StackError("Cannot align stacks: differing logical top")
382 if self.physical_sp == other.physical_sp:
383 return
384 diff = other.physical_sp - self.physical_sp
385 out.start_line()
386 out.emit(f"stack_pointer += {diff.to_c()};\n")
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):

Callers 2

mergeMethod · 0.95
ygFunction · 0.80

Calls 4

StackErrorClass · 0.85
start_lineMethod · 0.80
to_cMethod · 0.80
emitMethod · 0.45

Tested by

no test coverage detected