File tree Expand file tree Collapse file tree 1 file changed +22
-1
lines changed
src/main/java/com/javadeobfuscator/deobfuscator/transformers/general/peephole Expand file tree Collapse file tree 1 file changed +22
-1
lines changed Original file line number Diff line number Diff line change 3030
3131import static org .objectweb .asm .Opcodes .*;
3232
33- public class ConstantFolder extends Transformer <TransformerConfig > {
33+ @ TransformerConfig .ConfigOptions (configClass = ConstantFolder .Config .class )
34+ public class ConstantFolder extends Transformer <ConstantFolder .Config > {
3435
3536 @ Override
3637 public boolean transform () throws Throwable {
@@ -234,6 +235,10 @@ public boolean transform() throws Throwable {
234235 }
235236 case POP :
236237 case POP2 : {
238+ if (!getConfig ().isExperimentalPopFolding ()) {
239+ break ;
240+ }
241+
237242 List <Frame > frames = result .getFrames ().get (ain );
238243 if (frames == null ) {
239244 // wat
@@ -277,4 +282,20 @@ public boolean transform() throws Throwable {
277282
278283 return folded .get () > 0 ;
279284 }
285+
286+ public static class Config extends TransformerConfig {
287+ private boolean experimentalPopFolding ;
288+
289+ public Config () {
290+ super (ConstantFolder .class );
291+ }
292+
293+ public boolean isExperimentalPopFolding () {
294+ return experimentalPopFolding ;
295+ }
296+
297+ public void setExperimentalPopFolding (boolean experimentalPopFolding ) {
298+ this .experimentalPopFolding = experimentalPopFolding ;
299+ }
300+ }
280301}
You can’t perform that action at this time.
0 commit comments