X-Git-Url: https://git.m6w6.name/?p=m6w6%2Fext-psi;a=blobdiff_plain;f=src%2Fvalidate.c;h=2dfc3d46103b7d4a96be8069f19cdcf467670f3e;hp=1d55b13f26ca8a5b4c4d6e11ad7686b381017ec8;hb=fecb0372ee8e219a7ebd51406dee3e1008ccb7ec;hpb=02e801eabbe26a129ea05e6723c94e10bb653dab diff --git a/src/validate.c b/src/validate.c index 1d55b13..2dfc3d4 100644 --- a/src/validate.c +++ b/src/validate.c @@ -203,17 +203,20 @@ bool psi_validate(struct psi_validate_scope *scope, } /* nothing changed; bail out */ - if (count_all && (dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) { - /* one last error-spitting round, if not explicitly suppressed */ - dst->flags ^= PSI_SILENT; - check_count = ~0; + if (count_all) { + src->errors += count_all; - PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu" - " type checks remaining, errors follow\n", count_all); - continue; + if ((dst->flags & PSI_SILENT) && !(flags & PSI_SILENT)) { + /* one last error-spitting round, if not explicitly suppressed */ + dst->flags ^= PSI_SILENT; + check_count = ~0; + + PSI_DEBUG_PRINT(dst, "PSI: validation bail out with %zu" + " type checks remaining, errors follow\n", count_all); + continue; + } } - src->errors += count_all; break; } @@ -223,5 +226,30 @@ bool psi_validate(struct psi_validate_scope *scope, psi_validate_list(scope, dst, &consts, psi_validate_const); psi_validate_list(scope, dst, &impls, psi_validate_impl); + if (types.cur != types.src) { + psi_plist_free(types.cur); + } + if (structs.cur != structs.src) { + psi_plist_free(structs.cur); + } + if (unions.cur != unions.src) { + psi_plist_free(unions.cur); + } + if (enums.cur != enums.src) { + psi_plist_free(enums.cur); + } + if (vars.cur != vars.src) { + psi_plist_free(vars.cur); + } + if (decls.cur != decls.src) { + psi_plist_free(decls.cur); + } + if (consts.cur != consts.src) { + psi_plist_free(consts.cur); + } + if (impls.cur != impls.src) { + psi_plist_free(impls.cur); + } + return true; }