summaryrefslogtreecommitdiff
path: root/util
diff options
context:
space:
mode:
authorPatrick Georgi <pgeorgi@chromium.org>2016-12-15 15:14:59 +0100
committerPatrick Georgi <pgeorgi@google.com>2016-12-16 15:57:04 +0100
commitf78e658dac989a8c467de4d32ecf3f86dbb8e245 (patch)
treec675da64db14c6dba343b7b35b4de64ebb5dc611 /util
parentf23cba082c86bd7dd33ea3c26057206d790b3dab (diff)
downloadcoreboot-f78e658dac989a8c467de4d32ecf3f86dbb8e245.tar.xz
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>
Diffstat (limited to 'util')
-rw-r--r--util/romcc/romcc.c2
1 files changed, 1 insertions, 1 deletions
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;
}