Skip to content

Commit

Permalink
Merge pull request #469 from shifujun/insertAuxInitializer_stacksize
Browse files Browse the repository at this point in the history
Fix insertAuxInitializer may cause inconsistent stack height problem
  • Loading branch information
chibash committed Dec 16, 2023
2 parents 8cd171c + 2cdc027 commit 3325b49
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/main/javassist/CtClassType.java
Expand Up @@ -1763,8 +1763,7 @@ private static void insertAuxInitializer(CodeAttribute codeAttr,
int pos = it.insertEx(initializer.get());
it.insert(initializer.getExceptionTable(), pos);
int maxstack = codeAttr.getMaxStack();
if (maxstack < stacksize)
codeAttr.setMaxStack(stacksize);
codeAttr.setMaxStack(maxstack + stacksize);
}

private int makeFieldInitializer(Bytecode code, CtClass[] parameters)
Expand Down

0 comments on commit 3325b49

Please sign in to comment.