This is the mail archive of the gdb-patches@sourceware.org mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [RFA] i386-tdep.c, i386_process_record, document fall-through case.


> As my poor understanding of C language, break or not break are both OK
> for this part.

I'm going to be a little extremist, and I don't really mean what
I am about to ask, but: If the author of the code does not understand
the code, and no other maintainer is able to review associated patches,
is it time to remove that code?

Speaking about the patch itself, I had a look, and I think, from
what I understand, that, YES, the fallthrough is intended. IMO,
it would have been clearer to write the code as follow:

    case 0xc4:      /* les Gv */
    case 0xc5:      /* lds Gv */
    case 0x0fb2:    /* lss Gv */
    case 0x0fb4:    /* lfs Gv */
    case 0x0fb5:    /* lgs Gv */
      if ((opcode == 0xc4 || opcode == 0xc5)
          && ir.regmap[X86_RECORD_R8_REGNUM])
        {
          ir.addr -= 1;
          goto no_support;
        }
      if (i386_record_modrm (&ir))
        return -1;

(thus, not requiring a fallthrough)

So patch is approved.

-- 
Joel


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]