Skip to content

Commit 76a439f

Browse files
committed
validation BUGFIX invalid assert
1 parent da5ee3d commit 76a439f

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/validation.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -490,8 +490,14 @@ lyd_validate_unres(struct lyd_node **tree, const struct lys_module *mod, enum ly
490490
/* there must have been some when conditions resolved */
491491
} while (prev_count > node_when->count);
492492

493-
/* there could have been no cyclic when dependencies, checked during compilation */
494-
assert(!node_when->count || ((rc == LY_EVALID) && (val_opts & LYD_VALIDATE_MULTI_ERROR)));
493+
if (node_when->count) {
494+
/* there could have been no cyclic when dependencies, checked during compilation */
495+
assert((rc == LY_EVALID) && (val_opts & LYD_VALIDATE_MULTI_ERROR));
496+
497+
/* when condition was validated and it is not satisfied, error printed, if kept in the set the following
498+
* unres (for the next module) can fail this assert */
499+
ly_set_erase(node_when, NULL);
500+
}
495501
}
496502

497503
if (node_types && node_types->count) {

0 commit comments

Comments
 (0)