HSAFoundation/HSAIL-Tools — pull request #28 by abnikant (2014-05-16 11:09:38+00:00)
Title: Valgrind Error:Conditional jump or move depends on uninitialised value

Getting Valgrind error:
Conditional jump or move depends on uninitialised value(s)

After debug the error is found to be in the function
int BrigIO::load(BrigContainer &dst, int fmt, ReadAdapter& src) in HSAILBrigObjectFile.cpp file, as missing check.

The small test case to reproduce similar error:
[if a.txt is empty]
#include
#include
#include
int main()
{
unsigned char data[16];
char *filename = "a.txt";
int fd = open(filename, O_RDONLY, 0666);
int rc = read(fd, data, 16);
if (data[0] == '\n') printf("Success\n"); // rc && data[0]
return 1;
}