mirror of
https://github.com/timescale/timescaledb.git
synced 2025-05-18 03:23:37 +08:00
Fix false positive in coverity
Coverity assumes that casting a void pointer to anything else is tainted, which gives warning when casting the `rd_amcache` field to anything else. Since this is what the field is used for, we mark the cast from `void*` to `HypercoreInfo*` as a false positive.
This commit is contained in:
parent
647e558871
commit
76e3b27b69
@ -279,14 +279,15 @@ lazy_build_hypercore_info_cache(Relation rel, bool create_chunk_constraints,
|
||||
HypercoreInfo *
|
||||
RelationGetHypercoreInfo(Relation rel)
|
||||
{
|
||||
if (NULL == rel->rd_amcache)
|
||||
rel->rd_amcache = lazy_build_hypercore_info_cache(rel,
|
||||
true /* create constraints */,
|
||||
NULL /* compressed rel created */);
|
||||
/*coverity[tainted_data_downcast : FALSE]*/
|
||||
HypercoreInfo *info = rel->rd_amcache;
|
||||
|
||||
Assert(rel->rd_amcache && OidIsValid(((HypercoreInfo *) rel->rd_amcache)->compressed_relid));
|
||||
if (NULL == info)
|
||||
info = rel->rd_amcache = lazy_build_hypercore_info_cache(rel, true, NULL);
|
||||
|
||||
return rel->rd_amcache;
|
||||
Assert(info && OidIsValid(info->compressed_relid));
|
||||
|
||||
return info;
|
||||
}
|
||||
|
||||
static void
|
||||
|
Loading…
x
Reference in New Issue
Block a user