OCLDecoder PatchListSize fix

Change-Id: I8e4f809464b88d06ff4b5611888f1e6965aa4f19
This commit is contained in:
Krystian
2018-11-09 13:25:52 +01:00
committed by sys_ocldev
parent 66492a53a4
commit 5b9f5a6d9e
3 changed files with 83 additions and 92 deletions

View File

@@ -213,9 +213,11 @@ int BinaryDecoder::processBinary(void *&ptr, std::ostream &ptmFile) {
}
dumpField(ptr, v, ptmFile);
}
if (patchListSize == 0 || numberOfKernels == 0) {
printf("Error! Couldn't process program header.\n");
return -1;
if (patchListSize == 0) {
printf("Warning! Program's patch list size is 0.\n");
}
if (numberOfKernels == 0) {
printf("Warning! Number of Kernels is 0.\n");
}
readPatchTokens(ptr, patchListSize, ptmFile);
@@ -249,10 +251,7 @@ void BinaryDecoder::processKernel(void *&ptr, std::ostream &ptmFile) {
dumpField(ptr, v, ptmFile);
}
if (KernelPatchListSize == 0) {
printf("Error! KernelPatchListSize was 0.\n");
exit(1);
} else if (KernelNameSize == 0) {
if (KernelNameSize == 0) {
printf("Error! KernelNameSize was 0.\n");
exit(1);
}
@@ -281,6 +280,9 @@ void BinaryDecoder::processKernel(void *&ptr, std::ostream &ptmFile) {
writeDataToFile(fileName.c_str(), ptr, SurfaceStateHeapSize);
ptr = ptrOffset(ptr, SurfaceStateHeapSize);
if (KernelPatchListSize == 0) {
printf("Warning! Kernel's patch list size was 0.\n");
}
readPatchTokens(ptr, KernelPatchListSize, ptmFile);
}