validation CHANGE leafref validation fix
diff --git a/src/parser_lyb.c b/src/parser_lyb.c
index a30ca8e..60be7d9 100644
--- a/src/parser_lyb.c
+++ b/src/parser_lyb.c
@@ -512,8 +512,8 @@
/* we are parsing leafref/ptr union stored as the target type,
* so we first parse it into string and then resolve the leafref/ptr union */
- if (!(*value_flags & LY_VALUE_UNRES) && ((type->base == LY_TYPE_LEAFREF)
- || (type->base == LY_TYPE_INST) || ((type->base == LY_TYPE_UNION) && type->info.uni.has_ptr_type))) {
+ if ((type->base == LY_TYPE_LEAFREF) || (type->base == LY_TYPE_INST)
+ || ((type->base == LY_TYPE_UNION) && type->info.uni.has_ptr_type)) {
if ((value_type == LY_TYPE_INST) || (value_type == LY_TYPE_IDENT) || (value_type == LY_TYPE_UNION)) {
/* we already have a string */
goto parse_reference;
@@ -637,10 +637,7 @@
return -1;
}
- if (*value_flags & LY_VALUE_UNRES) {
- /* just remove the flag, it should stay unresolved */
- leaf->validity &= ~LYD_VAL_LEAFREF;
- } else if ((type->base == LY_TYPE_LEAFREF) || (type->base == LY_TYPE_INST)
+ if ((type->base == LY_TYPE_LEAFREF) || (type->base == LY_TYPE_INST)
|| ((type->base == LY_TYPE_UNION) && type->info.uni.has_ptr_type)) {
parse_reference:
assert(*value_str);