Add the PrivatizerIssue testcase to trigger the incorrect logic in Privatizer::getInitProgramPoint, then add a fix.
To check that a global array is completely initialized, privatizer expects the following pattern, where the instruction globalArray[i] = 20; is called a initializer of globalArray.
int globalArray[10];
void f() {
for (int i = 0; i < 10; i++) {
globalArray[i] = 20;
}
}
Privatizer didn't check initializers rigorously enough so that it would say globalArray2[i] = 40; is also a initializer, which is incorrect because globalArray2 is not completely initialized.
int globalArray2[10];
void f() {
for (int i = 0; i < 10; i++) {
if (i > 7) {
globalArray2[i] = 40;
}
}
}
Add the
PrivatizerIssue
testcase to trigger the incorrect logic in Privatizer::getInitProgramPoint, then add a fix.To check that a global array is completely initialized, privatizer expects the following pattern, where the instruction
globalArray[i] = 20;
is called a initializer ofglobalArray
.Privatizer didn't check initializers rigorously enough so that it would say
globalArray2[i] = 40;
is also a initializer, which is incorrect becauseglobalArray2
is not completely initialized.