History

Fix when bound checking and test coverage is used at the same time

herman ten brugge committed 4 years ago

Commit 4efcada1 parent 184d8451 file · +3 −3Browse files

Unified · Split

lib/bcheck.c+3−3
@@ -237,7 +237,7 @@ typedef struct alloca_list_struct { · 236 unmodified lines
237237 #define BOUND_GET_TID(id) id = syscall (SYS_gettid)
238238 #else
239239 #define BOUND_TID_TYPE int
240−#define BOUND_GET_TID(id) 0
240+#define BOUND_GET_TID(id) id = 0
241241 #endif
242242
243243 typedef struct jmp_list_struct {
@@ -1451,7 +1451,7 @@ void *__bound_malloc(size_t size, const void *caller) · 1207 unmodified lines
14511451 dprintf(stderr, "%s, %s(): %p, 0x%lx\n",
14521452 __FILE__, __FUNCTION__, ptr, (unsigned long)size);
14531453
1454− if (NO_CHECKING_GET() == 0) {
1454+ if (inited && NO_CHECKING_GET() == 0) {
14551455 WAIT_SEM ();
14561456 INCR_COUNT(bound_malloc_count);
14571457
@@ -1523,7 +1523,7 @@ void __bound_free(void *ptr, const void *caller) · 65 unmodified lines
15231523
15241524 dprintf(stderr, "%s, %s(): %p\n", __FILE__, __FUNCTION__, ptr);
15251525
1526− if (NO_CHECKING_GET() == 0) {
1526+ if (inited && NO_CHECKING_GET() == 0) {
15271527 WAIT_SEM ();
15281528 INCR_COUNT(bound_free_count);
15291529 tree = splay (addr, tree);

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t