checkpolicy: Remove uneeded return check in require_symbol()

Since symtab_insert() no longer returns -2 in the case of a
declaration of an identifier followed by a require of the same
symbol, remove the uneeded check.

Signed-off-by: James Carter <jwcart2@tycho.nsa.gov>
This commit is contained in:
James Carter 2017-01-31 13:47:48 -05:00
parent 8adbd615c1
commit 5d56c2679d

View File

@ -719,23 +719,15 @@ int require_symbol(uint32_t symbol_type,
avrule_decl_t *decl = stack_top->decl;
int ret = create_symbol(symbol_type, key, datum, dest_value, SCOPE_REQ);
if (ret == 0 || ret == 1) {
if (ebitmap_set_bit(decl->required.scope + symbol_type,
*datum_value - 1, 1)) {
return -3;
}
} else if (ret == -2) {
/* ignore require statements if that symbol was
* previously declared and is in current scope */
if (is_id_in_scope(symbol_type, key)) {
ret = 1;
} else {
return -2;
}
} else if (ret < 0) {
if (ret < 0) {
return ret;
}
if (ebitmap_set_bit(decl->required.scope + symbol_type,
*datum_value - 1, 1)) {
return -3;
}
stack_top->require_given = 1;
return ret;
}