Add container without template params to container map (#223)

Summary:

If a container has 0 template params (e.g. IOBuf, IOBufQueue), it wasn't
being added to containerTypeMap. This causes the deserialization to go wrong
as TreeBuilder doesn't treat the types as container

Test Plan:

make test
This commit is contained in:
arsarwade 2023-07-11 08:54:16 -07:00 committed by GitHub
parent f676112bbc
commit 188a2a82d0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -720,6 +720,11 @@ bool OICodeGen::enumerateTemplateParamIdxs(drgn_type* type,
const std::vector<size_t>& paramIdxs,
bool& ifStub) {
if (paramIdxs.empty()) {
// Containers such as IOBuf and IOBufQueue don't have template params, but
// still should be added to containerTypeMap
containerTypeMapDrgn.emplace(
type,
std::pair(std::ref(containerInfo), std::vector<drgn_qualified_type>()));
return true;
}