@@ -113,13 +113,22 @@ Error build_descriptors(Context& c, CudaDelegateHandle* h) {
113113 auto container = h->container_handle ;
114114
115115 size_t n = 0 ;
116- h->get_num_constants (container, &n);
116+ ET_CHECK_OK_OR_RETURN_ERROR (
117+ h->get_num_constants (container, &n),
118+ " mutable_state: get_num_constants failed" );
117119 std::unordered_map<std::string, std::string> fqn_to_internal;
118120 for (size_t i = 0 ; i < n; ++i) {
119121 const char * internal = nullptr ;
120122 const char * fqn = nullptr ;
121- h->get_constant_name (container, i, &internal);
122- h->get_constant_original_fqn (container, i, &fqn);
123+ ET_CHECK_OK_OR_RETURN_ERROR (
124+ h->get_constant_name (container, i, &internal),
125+ " mutable_state: get_constant_name failed" );
126+ ET_CHECK_OK_OR_RETURN_ERROR (
127+ h->get_constant_original_fqn (container, i, &fqn),
128+ " mutable_state: get_constant_original_fqn failed" );
129+ // A successful call may still report an unusable (null/empty) name --
130+ // that's a method-scoped constant, not an error: skip it (another container
131+ // owns it). A non-OK return code above is a real failure and falls closed.
123132 if (internal && fqn && fqn[0 ] != ' \0 ' ) {
124133 fqn_to_internal[fqn] = internal;
125134 }
0 commit comments