def enhance_inst(inst, off, line, is_line_start, stack):
    """
  Add some useful fields to Instruction:
  * off: logical offset; the address of the first EXTENDED_ARG for instructions with preceding EXTENDED_ARG.
  * line: the preceding start_line if this instruction does not have one.
  * is_line_start: bool of starts_line, but also True when preceded by EXTENDED_ARG that has starts_line set.
  * stack: represents the approximate static scope of all live frames on the block stack.
  The remaining fields are flags that are set in certain cases.
  """
    inst.off = off
    inst.line = line
    inst.is_line_start = is_line_start
    inst.stack = stack
    inst.is_SF_exc_opt = False
    inst.is_exc_match = False
    inst.is_exc_match_jmp_src = False
    inst.is_exc_match_jmp_dst = False
