abnikant/HSAIL-Tools — pull request #1 by abnikant (2014-05-15 12:03:28+00:00)
Title: Valgrind Error: Conditional jump or move depends on uninitialised value

Getting the 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 the 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;
}