From f78e658dac989a8c467de4d32ecf3f86dbb8e245 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 15 Dec 2016 15:14:59 +0100 Subject: util/romcc: Move access after NULL-check Change-Id: I7f9c38fd6e75b32fe1ed8a60c7054f4dd1fcd5c0 Signed-off-by: Patrick Georgi Found-by: Coverity Scan #1129104 Reviewed-on: https://review.coreboot.org/17884 Tested-by: build bot (Jenkins) Reviewed-by: Martin Roth --- util/romcc/romcc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util') diff --git a/util/romcc/romcc.c b/util/romcc/romcc.c index 9a9016741f..655e6f5ed1 100644 --- a/util/romcc/romcc.c +++ b/util/romcc/romcc.c @@ -6287,10 +6287,10 @@ static size_t field_reg_offset(struct compile_state *state, internal_error(state, 0, "field_reg_offset only works on structures and unions"); } - size += reg_needed_padding(state, member, size); if (!member || (member->field_ident != field)) { error(state, 0, "member %s not present", field->name); } + size += reg_needed_padding(state, member, size); return size; } -- cgit v1.2.3