A more aggressive workaround for bug #1156

git-svn-id: https://svn.code.sf.net/p/nsis/code/NSIS/trunk@6804 212acab6-be3b-0410-9dea-997c60f758d6
This commit is contained in:
anders_k 2016-11-25 21:35:28 +00:00
parent 7339c8c795
commit 62b8ca9bb5

View file

@ -17,11 +17,12 @@ public:
void randData(IGrowBuf &buf, int kb) {
srand(time(0));
#define IsBug1156(r) ( ((r) & 0x80) == 0x80 )
for (int i = 0; i < kb; i++) {
int r;
do
r = rand();
while (0x3dd0def3 == r); // Temporary workaround for https://sf.net/p/nsis/bugs/1156/#zlibCompressionTest loops endlessly
while (IsBug1156(r)); // Temporary workaround for https://sf.net/p/nsis/bugs/1156/#zlibCompressionTest loops endlessly
for (size_t j = 0; j < 1024/sizeof(int); j++) {
buf.add(&r, sizeof(int));
}