/* call-seq:
 *   iseq.insn_line(n) => Integer
 *
 * Returns the line number of the nth instruction in the sequence.
 */
static VALUE iseq_insn_line(VALUE self, VALUE n)
{
  rb_iseq_t *iseqdat = iseq_check(self);
  unsigned long pos = NUM2LONG(n);
  unsigned long i, size = iseqdat->insn_info_size;
  struct iseq_insn_info_entry *iiary = iseqdat->insn_info_table;

  for (i = 0; i < size; i++) {
      if (iiary[i].position == pos) {
          return INT2NUM(iiary[i].line_no);
      }
  }
  return Qnil;
}