OSDN Git Service

(jump_optimize): Ensure operand of REG_NOTES is an INSN; otherwise, we
authorkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Nov 1992 19:57:52 +0000 (19:57 +0000)
committerkenner <kenner@138bc75d-0d04-0410-961f-82ee72b054a4>
Tue, 3 Nov 1992 19:57:52 +0000 (19:57 +0000)
might try to read outside allocated memory.

git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@2684 138bc75d-0d04-0410-961f-82ee72b054a4

gcc/jump.c

index 63f5313..5ed2828 100644 (file)
@@ -837,6 +837,7 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
              && this_is_condjump && ! this_is_simplejump
              && BRANCH_COST >= 3
              && (temp = next_nonnote_insn (insn)) != 0
+             && GET_CODE (temp) == INSN
              && REG_NOTES (temp) == 0
              && (reallabelprev == temp
                  || ((temp2 = next_active_insn (temp)) != 0
@@ -874,8 +875,10 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
              && this_is_condjump && ! this_is_simplejump
              && BRANCH_COST >= 4
              && (temp = next_nonnote_insn (insn)) != 0
+             && GET_CODE (temp) == INSN
              && REG_NOTES (temp) == 0
              && (temp3 = next_nonnote_insn (temp)) != 0
+             && GET_CODE (temp3) == INSN
              && REG_NOTES (temp3) == 0
              && (reallabelprev == temp3
                  || ((temp2 = next_active_insn (temp3)) != 0
@@ -920,8 +923,10 @@ jump_optimize (f, cross_jump, noop_moves, after_regscan)
              && this_is_condjump && ! this_is_simplejump
              && BRANCH_COST >= 4
              && (temp = next_nonnote_insn (insn)) != 0
+             && GET_CODE (temp) == INSN
              && REG_NOTES (temp) == 0
              && (temp3 = next_nonnote_insn (temp)) != 0
+             && GET_CODE (temp3) == INSN
              && REG_NOTES (temp3) == 0
              && (reallabelprev == temp3
                  || ((temp2 = next_active_insn (temp3)) != 0