Page 1 of 1

issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Posted: Wed May 27, 2015 5:26 pm
by Josef Templ
This voting is about merging the changes of topic branch issue-#55
(DevPacker.RemoveWhiteSpaces loops at the end of the text) to master.
For the issue see http://redmine.blackboxframework.org/issues/55.
For the changes see http://redmine.blackboxframework.org/pr ... c03600dc32.

The changes are based on the proposal in CPC 1.7 rc5 and fix an endless loop
that appears when reading past the end of text in DevPacker.

Gentlemen, please cast your vote.

- Josef

Re: issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Posted: Wed May 27, 2015 9:49 pm
by DGDanforth

Code: Select all

WHILE ~rd.eot & (rd.Pos() <= end) & (rd.char <= 20X) DO GetCh(rd) END
Only if a valid previous call to GetCh has been done is this code valid. If not then the code should be
GetCh(rd);
WHILE ~rd.eot & (rd.Pos() <= end) & (rd.char <= 20X) DO GetCh(rd) END

Re: issue-#55 endless loop in DevPacker.RemoveWhiteSpaces

Posted: Thu May 28, 2015 4:23 am
by Josef Templ
As far as I see, "GetCh(rd);" is always called prior to RemoveWhiteSpaces.
rd always starts at PackThis, which starts with ParseExe, which starts with GetCh.
Thus, rd.eot should be well defined in all cases.
The suggested alternative solution would skip a character in many cases.

- Josef