mirror of
https://github.com/intel/compute-runtime.git
synced 2026-01-05 09:09:04 +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
@@ -48,7 +48,9 @@ class PrintFormatter {
|
||||
PrintFormatter(const uint8_t *printfOutputBuffer, uint32_t printfOutputBufferMaxSize,
|
||||
bool using32BitPointers, const StringMap *stringLiteralMap = nullptr);
|
||||
void printKernelOutput(const std::function<void(char *)> &print = [](char *str) { printToStdout(str); });
|
||||
|
||||
void setInitialOffset(uint32_t offset) {
|
||||
initialOffset = offset;
|
||||
}
|
||||
constexpr static size_t maxSinglePrintStringLength = 16 * MemoryConstants::kiloByte;
|
||||
|
||||
protected:
|
||||
@@ -132,5 +134,6 @@ class PrintFormatter {
|
||||
const StringMap *stringLiteralMap;
|
||||
|
||||
uint32_t currentOffset = 0; // current position in currently parsed buffer
|
||||
uint32_t initialOffset = 0; // initial offset - reserved memory for header in buffer
|
||||
};
|
||||
}; // namespace NEO
|
||||
|
||||
Reference in New Issue
Block a user