tree schema CHANGE flags LYS_MODS_LATEST_*
If ::LYS_MOD_LATEST_SEARCHDIRS is set, then ::LYS_MOD_LATEST_REV must
be set too.
diff --git a/src/context.c b/src/context.c
index f45be51..328de40 100644
--- a/src/context.c
+++ b/src/context.c
@@ -761,7 +761,7 @@
uint32_t index = 0;
while ((mod = ly_ctx_get_module_by_iter(ctx, key, 0, key_offset, &index))) {
- if (mod->latest_revision & (LYS_MOD_LATEST_REV | LYS_MOD_LATEST_SEARCHDIRS)) {
+ if (mod->latest_revision & LYS_MOD_LATEST_REV) {
return mod;
}
}
@@ -930,13 +930,13 @@
mod = ctx->list.objs[v];
if (mod->latest_revision & LYS_MOD_LATEST_SEARCHDIRS) {
mod->latest_revision &= ~LYS_MOD_LATEST_SEARCHDIRS;
- mod->latest_revision |= LYS_MOD_LATEST_REV;
+ assert(mod->latest_revision & LYS_MOD_LATEST_REV);
}
if (mod->parsed && mod->parsed->includes) {
for (LY_ARRAY_COUNT_TYPE u = 0; u < LY_ARRAY_COUNT(mod->parsed->includes); ++u) {
if (mod->parsed->includes[u].submodule->latest_revision & LYS_MOD_LATEST_SEARCHDIRS) {
mod->parsed->includes[u].submodule->latest_revision &= ~LYS_MOD_LATEST_SEARCHDIRS;
- mod->parsed->includes[u].submodule->latest_revision |= LYS_MOD_LATEST_REV;
+ assert(mod->latest_revision & LYS_MOD_LATEST_REV);
}
}
}