Skip to content

Commit

Permalink
[FIX] OutOfMemory.
Browse files Browse the repository at this point in the history
  • Loading branch information
Zaxar163 committed Mar 11, 2020
1 parent 5598208 commit 2edb2c7
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@ public void invoke(String... args) throws Exception {
{
Class<? extends UnsafePatcher> clazz = (Class<? extends UnsafePatcher>) Class.forName(name);
try {
String[] real_args = Arrays.copyOfRange(args, 3, Integer.MAX_VALUE);
patcher = (UnsafePatcher) MethodHandles.publicLookup().findConstructor(clazz, MethodType.methodType(void.class)).invokeWithArguments(Arrays.asList(real_args));
String[] real_args = Arrays.copyOfRange(args, 3, args.length);
if (real_args.length > 0)
patcher = (UnsafePatcher) MethodHandles.publicLookup().findConstructor(clazz, MethodType.methodType(void.class, String[].class)).asFixedArity().invoke(real_args);
else
patcher = (UnsafePatcher) MethodHandles.publicLookup().findConstructor(clazz, MethodType.methodType(void.class)).invoke();
} catch (Throwable e)
{
LogHelper.dev(LogHelper.toString(e));
Expand Down

0 comments on commit 2edb2c7

Please sign in to comment.