LocalVariablesSorter.remap() incorrectly process long/double types
LocalVariablesSorter.remap(final int var, final Type type) method contains the following condition:
if (var < firstLocal) {
return var;
}
to check whether the remapping is required.
It works as expected when type size is 1. At the same time when (var == firstLocal - 1) and (type ==
Type.LONG_TYPE) the remapping should be performed. However above condition leads to missing
remapping. As a result maxLocals can be calculated incorrectly.
The following fix is suggested to take into account the long/double types:
if (var + type.getSize() <= firstLocal) {
return var;
}