mirror of
https://github.com/varun-r-mallya/sysprof.git
synced 2026-02-10 15:10:53 +00:00
stackstash: add assertions before silencing warnings
GCC warns about dangling pointers here, which is completely fine given how this code works.
This commit is contained in:
@ -273,7 +273,10 @@ do_callback (StackNode *node,
|
|||||||
StackLink link;
|
StackLink link;
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
|
{
|
||||||
|
g_assert (trace->prev == NULL);
|
||||||
trace->prev = &link;
|
trace->prev = &link;
|
||||||
|
}
|
||||||
|
|
||||||
link.next = trace;
|
link.next = trace;
|
||||||
link.prev = NULL;
|
link.prev = NULL;
|
||||||
@ -291,7 +294,10 @@ do_callback (StackNode *node,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (trace)
|
if (trace)
|
||||||
|
{
|
||||||
|
g_assert (trace->prev == &link);
|
||||||
trace->prev = NULL;
|
trace->prev = NULL;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user