util/romcc: Add extra null pointer check
It is possible that 'lnode->val' is set to 0 on a previous iteration of the loop, so check that it is non-null here before dereferencing it. Change-Id: I9827dd5623eaf11240df605a8b50ff9e27a5fce0 Signed-off-by: Jacob Garber <jgarber1@ualberta.ca> Found-by: Coverity CID 1129149 Reviewed-on: https://review.coreboot.org/c/coreboot/+/32917 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Patrick Georgi <pgeorgi@google.com>
This commit is contained in:
parent
9742ae1d11
commit
298afb3140
|
@ -20944,7 +20944,8 @@ static void scc_visit_phi(struct compile_state *state, struct scc_state *scc,
|
|||
}
|
||||
}
|
||||
/* meet(const, const) = const or lattice low */
|
||||
else if (!constants_equal(state, lnode->val, tmp->val)) {
|
||||
else if (lnode->val != 0 &&
|
||||
!constants_equal(state, lnode->val, tmp->val)) {
|
||||
lnode->val = 0;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue