[PATCH] fix missing checks for deleted instructions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Instructions with a null ->bb are instructions which have
been killed. As such, they must thus always be ignored.

Fix this by adding the missing checks for null ->bb when
looping over all the instructions of a basic block.

Signed-off-by: Luc Van Oostenryck <luc.vanoostenryck@xxxxxxxxx>
---
 graph.c  | 2 ++
 sparse.c | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/graph.c b/graph.c
index c9af9a580..a24c6e177 100644
--- a/graph.c
+++ b/graph.c
@@ -74,6 +74,8 @@ static void graph_ep(struct entrypoint *ep)
 
 		/* List loads and stores */
 		FOR_EACH_PTR(bb->insns, insn) {
+			if (!insn->bb)
+				continue;
 			switch(insn->opcode) {
 			case OP_STORE:
 				if (insn->symbol->type == PSEUDO_SYM) {
diff --git a/sparse.c b/sparse.c
index 768b91253..056d14ff6 100644
--- a/sparse.c
+++ b/sparse.c
@@ -47,6 +47,8 @@ static int context_increase(struct basic_block *bb, int entry)
 
 	FOR_EACH_PTR(bb->insns, insn) {
 		int val;
+		if (!insn->bb)
+			continue;
 		if (insn->opcode != OP_CONTEXT)
 			continue;
 		val = insn->increment;
-- 
2.17.0

--
To unsubscribe from this list: send the line "unsubscribe linux-sparse" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Newbies FAQ]     [LKML]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Trinity Fuzzer Tool]

  Powered by Linux