[PATCH] java/jcf-write.c

Andrew Haley aph@pasanda.cygnus.co.uk
Thu Jan 27 11:07:00 GMT 2000


This is a simple buffer overrun patch for some Java bytecode insns.

I checked it in.

Andrew.

2000-01-27  Andrew Haley  <aph@cygnus.com>

        * jcf-write.c (emit_goto): RESERVE 3 bytes for insn.
        (emit_if): Ditto.
        (emit_jsr): Ditto.

Index: jcf-write.c
===================================================================
RCS file: /cvs/gcc/egcs/gcc/java/jcf-write.c,v
retrieving revision 1.44
diff -p -2 -c -r1.44 jcf-write.c
*** jcf-write.c	2000/01/21 20:57:00	1.44
--- jcf-write.c	2000/01/27 19:03:50
*************** emit_if (target, opcode, inv_opcode, sta
*** 1087,1090 ****
--- 1087,1091 ----
       struct jcf_partial *state;
  {
+   RESERVE(3);
    OP1 (opcode);
    /* value is 1 byte from reloc back to start of instruction.  */
*************** emit_goto (target, state)
*** 1097,1100 ****
--- 1098,1102 ----
       struct jcf_partial *state;
  {
+   RESERVE(3);
    OP1 (OPCODE_goto);
    /* Value is 1 byte from reloc back to start of instruction.  */
*************** emit_jsr (target, state)
*** 1107,1110 ****
--- 1109,1113 ----
       struct jcf_partial *state;
  {
+   RESERVE(3);
    OP1 (OPCODE_jsr);
    /* Value is 1 byte from reloc back to start of instruction.  */


More information about the Gcc-patches mailing list