mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-21 01:04:57 +08:00
fix: assert message printing
- assert buffer has header that needs to be accounted for while parsing the buffer and reading format strings. currentOffset in Printf Formatter must not exceed size in header. The offset is relative to the beginning of buffer, not the "begin" field in header Resolves: NEO-8237 Signed-off-by: Mateusz Hoppe <mateusz.hoppe@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
53e85728cd
commit
c44b600ec7
@@ -35,7 +35,7 @@ bool AssertHandler::checkAssert() const {
|
||||
|
||||
void AssertHandler::printMessage() const {
|
||||
|
||||
auto messageBuffer = ptrOffset(static_cast<uint8_t *>(assertBuffer->getUnderlyingBuffer()), offsetof(AssertBufferHeader, begin));
|
||||
auto messageBuffer = static_cast<uint8_t *>(assertBuffer->getUnderlyingBuffer());
|
||||
auto messageBufferSize = static_cast<uint32_t>(assertBuffer->getUnderlyingBufferSize());
|
||||
|
||||
NEO::PrintFormatter printfFormatter{
|
||||
@@ -43,6 +43,8 @@ void AssertHandler::printMessage() const {
|
||||
messageBufferSize,
|
||||
false,
|
||||
nullptr};
|
||||
printfFormatter.setInitialOffset(offsetof(AssertBufferHeader, begin));
|
||||
|
||||
printfFormatter.printKernelOutput([](char *str) { printToStderr(str); });
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user