Skip to content

Commit f42e372

Browse files
authored
add assert to suppress coverity issue (#1846)
1 parent a17e082 commit f42e372

File tree

1 file changed

+5
-2
lines changed

1 file changed

+5
-2
lines changed

src/tbbmalloc/backend.cpp

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
/*
2-
Copyright (c) 2005-2023 Intel Corporation
2+
Copyright (c) 2005-2025 Intel Corporation
3+
Copyright (c) 2025 UXL Foundation Contributors
34
45
Licensed under the Apache License, Version 2.0 (the "License");
56
you may not use this file except in compliance with the License.
@@ -1274,7 +1275,9 @@ void Backend::startUseBlock(MemRegion *region, FreeBlock *fBlock, bool addToBin)
12741275
lastBl->memRegion = region;
12751276

12761277
if (addToBin) {
1277-
unsigned targetBin = sizeToBin(blockSz);
1278+
int targetBin = sizeToBin(blockSz);
1279+
MALLOC_ASSERT(targetBin >= 0, ASSERT_TEXT);
1280+
12781281
// during adding advance regions, register bin for a largest block in region
12791282
advRegBins.registerBin(targetBin);
12801283
if (region->type == MEMREG_SLAB_BLOCKS) {

0 commit comments

Comments
 (0)