Skip to content

Commit

Permalink
#124 fix scan-build error
Browse files Browse the repository at this point in the history
  • Loading branch information
SanderMertens committed Feb 18, 2022
1 parent cbc1ecf commit a2efbef
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 2 deletions.
4 changes: 4 additions & 0 deletions flecs.c
Original file line number Diff line number Diff line change
Expand Up @@ -18805,6 +18805,8 @@ void insert_select_or_with(
eval_subject_supersets = true;

} else if (ecs_id_is_wildcard(term->id)) {
ecs_assert(subj != NULL, ECS_INTERNAL_ERROR, NULL);

op = insert_operation(rule, -1, written);

if (!is_known(subj, written)) {
Expand Down Expand Up @@ -20155,6 +20157,8 @@ bool eval_superset(
return false;
}

ecs_assert(table != NULL, ECS_INTERNAL_ERROR, NULL);

ecs_entity_t col_entity = rule_get_column(table->type, column);
ecs_entity_t col_obj = ecs_entity_t_lo(col_entity);

Expand Down
4 changes: 4 additions & 0 deletions src/addons/rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -2074,6 +2074,8 @@ void insert_select_or_with(
eval_subject_supersets = true;

} else if (ecs_id_is_wildcard(term->id)) {
ecs_assert(subj != NULL, ECS_INTERNAL_ERROR, NULL);

op = insert_operation(rule, -1, written);

if (!is_known(subj, written)) {
Expand Down Expand Up @@ -3424,6 +3426,8 @@ bool eval_superset(
return false;
}

ecs_assert(table != NULL, ECS_INTERNAL_ERROR, NULL);

ecs_entity_t col_entity = rule_get_column(table->type, column);
ecs_entity_t col_obj = ecs_entity_t_lo(col_entity);

Expand Down
3 changes: 2 additions & 1 deletion test/api/project.json
Original file line number Diff line number Diff line change
Expand Up @@ -1621,7 +1621,8 @@
"test_subj_w_pair_wildcard_w_isa_2_lvls",
"test_this_w_wildcard_w_isa",
"test_this_w_wildcard_w_isa_2_lvls",
"test_this_w_wildcard_w_2_isa"
"test_this_w_wildcard_w_2_isa",
"test_this_w_wildcard_w_isa_no_owned"
]
}, {
"id": "TransitiveRules",
Expand Down
4 changes: 4 additions & 0 deletions test/api/src/Rules.c
Original file line number Diff line number Diff line change
Expand Up @@ -6226,3 +6226,7 @@ void Rules_test_this_w_wildcard_w_2_isa() {

ecs_fini(world);
}

void Rules_test_this_w_wildcard_w_isa_no_owned() {
// Implement testcase
}
7 changes: 6 additions & 1 deletion test/api/src/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1554,6 +1554,7 @@ void Rules_test_subj_w_pair_wildcard_w_isa_2_lvls(void);
void Rules_test_this_w_wildcard_w_isa(void);
void Rules_test_this_w_wildcard_w_isa_2_lvls(void);
void Rules_test_this_w_wildcard_w_2_isa(void);
void Rules_test_this_w_wildcard_w_isa_no_owned(void);

// Testsuite 'TransitiveRules'
void TransitiveRules_trans_X_X(void);
Expand Down Expand Up @@ -8482,6 +8483,10 @@ bake_test_case Rules_testcases[] = {
{
"test_this_w_wildcard_w_2_isa",
Rules_test_this_w_wildcard_w_2_isa
},
{
"test_this_w_wildcard_w_isa_no_owned",
Rules_test_this_w_wildcard_w_isa_no_owned
}
};

Expand Down Expand Up @@ -12222,7 +12227,7 @@ static bake_test_suite suites[] = {
"Rules",
NULL,
NULL,
152,
153,
Rules_testcases
},
{
Expand Down

0 comments on commit a2efbef

Please sign in to comment.