Tracing: Clear offload buffer pointers when no longer needed
These are also used as a marker (when non-nullptr) when creating a buffer. Reset them when they are not valid to avoid invalid write if a buffer is created after a close (due to a subsequent re-open). Fixes #3651.
This commit is contained in:
parent
10fc1f757c
commit
2fc1746ef5
|
|
@ -644,6 +644,10 @@ void VerilatedTrace<VL_SUB_T, VL_BUF_T>::dump(uint64_t timeui) VL_MT_SAFE_EXCLUD
|
||||||
// Assert no buffer overflow
|
// Assert no buffer overflow
|
||||||
assert(m_offloadBufferWritep - bufferp <= m_offloadBufferSize);
|
assert(m_offloadBufferWritep - bufferp <= m_offloadBufferSize);
|
||||||
|
|
||||||
|
// Reset our pointers as we are giving up the buffer
|
||||||
|
m_offloadBufferWritep = nullptr;
|
||||||
|
m_offloadBufferEndp = nullptr;
|
||||||
|
|
||||||
// Pass it to the worker thread
|
// Pass it to the worker thread
|
||||||
m_offloadBuffersToWorker.put(bufferp);
|
m_offloadBuffersToWorker.put(bufferp);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue