This is the mail archive of the
gcc-patches@gcc.gnu.org
mailing list for the GCC project.
[PATCH] java/jcf-write.c
- To: egcs-patches at egcs dot cygnus dot com
- Subject: [PATCH] java/jcf-write.c
- From: Andrew Haley <aph at pasanda dot cygnus dot co dot uk>
- Date: 27 Jan 2000 19:07:51 -0000
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. */