[coreboot-gerrit] New patch to review for coreboot: util/romcc: Don't reference a variable after checking it for NULL
Patrick Georgi (pgeorgi@google.com)
gerrit at coreboot.org
Thu Dec 15 15:25:46 CET 2016
Patrick Georgi (pgeorgi at google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17886
-gerrit
commit 8b21ab6c00c0815ca11af05fccab83fe6623b06e
Author: Patrick Georgi <pgeorgi at chromium.org>
Date: Thu Dec 15 15:21:56 2016 +0100
util/romcc: Don't reference a variable after checking it for NULL
Change-Id: Ic8e850bdf75d38fc061fb3a8c55d38bcf09c305a
Signed-off-by: Patrick Georgi <pgeorgi at chromium.org>
Found-by: Coverity Scan #1129146
---
util/romcc/romcc.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c
index 7b5e5d7..052be12 100644
--- a/util/romcc/romcc.c
+++ b/util/romcc/romcc.c
@@ -21322,15 +21322,15 @@ static void verify_blocks(struct compile_state *state)
"computed users %d != stored users %d",
users, block->users);
}
+ if (!(block->last->next)) {
+ internal_error(state, block->first,
+ "bad next block");
+ }
if (!triple_stores_block(state, block->last->next)) {
internal_error(state, block->last->next,
"cannot find next block");
}
block = block->last->next->u.block;
- if (!block) {
- internal_error(state, block->last->next,
- "bad next block");
- }
} while(block != state->bb.first_block);
if (blocks != state->bb.last_vertex) {
internal_error(state, 0, "computed blocks: %d != stored blocks %d",
More information about the coreboot-gerrit
mailing list