-
Notifications
You must be signed in to change notification settings - Fork 3
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Failing to split use case #1
Comments
Yeah, this is a limitation of the algorithm I chose. I specifically chose to split off a large set of instructions without jumps. If there are no large sets of instructions, but instead a bunch of small sets inside a switch, it will take a different algorithm. I'm afraid it doesn't fit my use case to split large switches, but this shouldn't hard to dev. Just take LookupSwitchInsnNode and take out half (or however many) the pairs, make a new method, have the default case of the now=halved lookup call the other with the same index var, and build the switch there. |
I also got a null pointer thrown from this line, https://github.com/cretz/msplit/blob/master/src/main/java/msplit/Splitter.java#L352. This caused because there is a throw instruction before this store instruction. After throws and returns, the adapter you use clears the stack. Hence it is very frequent to hit this NPE. A fix from you would be nice. |
@vinok88 got the same NPE with GOTO instruction on cretz/asmble#30. I am trying to investigate it now, could you please provide your test case? |
The problem here is in absence of
And here More docs could be found in the visitFrame docs. |
Firstly, this is some awesome work so thank you for your time.
JD-GUI can display the class. Jar is here https://www.dropbox.com/s/u36hzev27hcgq8h/large%20method.jar?dl=1
The offending method in question has a huge switch statement. 31152 Instructions.
Code I'm using
Output
Exception in thread "Thread-7" java.lang.NullPointerException: splitmethod failed :(
Disclosure, Im new to ASM. I tried ASM 4&5 in constructor params and min/max ranges of 2k - 15k, 20k 25k
The text was updated successfully, but these errors were encountered: