Closed xem closed 5 years ago
Variable reassignment fails, there are more names to replace than available characters. I'll keep investigating to understand why since this condition was not supposed to be possible.
Nailed it.
z
is one of the variables, but is missing from the replacement candidates. Henceforth, there is one variable missing for the replacement.
The bug is in Shapeshifter::reassignVariableNames()
, upon building the candidate variable list in the variable unusedBlocks
. If a block is initiated inside the loop, but not terminated (no keyword found in between), if never gets added to the list.
Proposed fix : after the loop, if a block is started (blockStartsAt!=-1)
, append it to the loop. nextToLast
can be set at 128, above the ASCII range.
In the meantime, you can disable "reassign vars" with no ill effect, as no replacement is performed anyway - there is simply no unused variable name.
Implemented proposed fix - solves the issue.
https://github.com/Siorki/RegPack/commit/a61e8090fd71618e4470fed4471ff4d76fbbcfd2 in branch master
(in case we want to publish a v5.0.3 while working on v6.0)
Hello,
RegPack gives me this error when I try to pack this code:
I think it's not my fault... but I don't know what happens
EDIT: it works when I uncheck the "reassign vars" option.