From 8b44cced5511b5d8aae677248a3a719247e2d08b Mon Sep 17 00:00:00 2001 From: foreman Date: Tue, 16 May 2017 11:22:14 -0400 Subject: [PATCH] P4 to Git Change 1410153 by wchau@wchau_OCL_boltzmann on 2017/05/16 11:07:21 SWDEV-121587 - [OCL] Segmentation fault when program is used without built first. Fix the issue by adding sanity check for the symbol table before using it. Affected files ... ... //depot/stg/opencl/drivers/opencl/runtime/platform/program.cpp#87 edit --- rocclr/runtime/platform/program.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/rocclr/runtime/platform/program.cpp b/rocclr/runtime/platform/program.cpp index 979b4ccb29..f9926a83bb 100644 --- a/rocclr/runtime/platform/program.cpp +++ b/rocclr/runtime/platform/program.cpp @@ -38,6 +38,11 @@ Program::~Program() { } const Symbol* Program::findSymbol(const char* kernelName) const { + // avoid seg. fault if the program has not built yet + if (symbolTable_ == NULL) { + return NULL; + } + symbols_t::const_iterator it = symbolTable_->find(kernelName); return (it == symbolTable_->end()) ? NULL : &it->second; }