From d9e6788a15eaa0411883c82f3ab330b97c64f1aa Mon Sep 17 00:00:00 2001 From: rdeioris Date: Mon, 4 Nov 2024 06:54:28 +0100 Subject: [PATCH] fixed Inheritance caching bug and typeName management --- src/composition.cc | 6 ++++-- src/prim-types.cc | 3 ++- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/composition.cc b/src/composition.cc index ec5e4934..3b0518fc 100644 --- a/src/composition.cc +++ b/src/composition.cc @@ -1275,9 +1275,11 @@ static bool InheritPrimSpecImpl(PrimSpec &dst, const PrimSpec &src, // Then override it with `dst` PrimSpec ps = src; // copy - // Keep PrimSpec name, typeName and spec from `dst` + // Keep PrimSpec name, typeName (if not empty) and spec from `dst` ps.name() = dst.name(); - ps.typeName() = dst.typeName(); + if (!dst.typeName().empty()) { + ps.typeName() = dst.typeName(); + } ps.specifier() = dst.specifier(); // Override metadataum diff --git a/src/prim-types.cc b/src/prim-types.cc index 2dc5afd4..3b95dddf 100644 --- a/src/prim-types.cc +++ b/src/prim-types.cc @@ -2175,7 +2175,8 @@ bool Layer::find_primspec_at(const Path &path, const PrimSpec **ps, auto ret = _primspec_path_cache.find(path.prim_part()); if (ret != _primspec_path_cache.end()) { DCOUT("Found cache."); - return ret->second; + (*ps) = ret->second; + return true; } }