util/romcc: Move access after NULL-check

Change-Id: I7f9c38fd6e75b32fe1ed8a60c7054f4dd1fcd5c0
Signed-off-by: Patrick Georgi <pgeorgi@chromium.org>
Found-by: Coverity Scan #1129104
Reviewed-on: https://review.coreboot.org/17884
Tested-by: build bot (Jenkins)
Reviewed-by: Martin Roth <martinroth@google.com>
This commit is contained in:
Patrick Georgi 2016-12-15 15:14:59 +01:00 committed by Patrick Georgi
parent f23cba082c
commit f78e658dac
1 changed files with 1 additions and 1 deletions

View File

@ -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;
}