1
1
/*
2
- * Copyright 2002-2017 the original author or authors.
2
+ * Copyright 2002-2018 the original author or authors.
3
3
*
4
4
* Licensed under the Apache License, Version 2.0 (the "License");
5
5
* you may not use this file except in compliance with the License.
@@ -77,8 +77,10 @@ public boolean isCompilable() {
77
77
public void generateCode (MethodVisitor mv , CodeFlow cf ) {
78
78
// exit type descriptor can be null if both components are literal expressions
79
79
computeExitTypeDescriptor ();
80
+ cf .enterCompilationScope ();
80
81
this .children [0 ].generateCode (mv , cf );
81
82
CodeFlow .insertBoxIfNecessary (mv , cf .lastDescriptor ().charAt (0 ));
83
+ cf .exitCompilationScope ();
82
84
Label elseTarget = new Label ();
83
85
Label endOfIf = new Label ();
84
86
mv .visitInsn (DUP );
@@ -91,10 +93,12 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
91
93
mv .visitJumpInsn (IFEQ , endOfIf ); // if not empty, drop through to elseTarget
92
94
mv .visitLabel (elseTarget );
93
95
mv .visitInsn (POP );
96
+ cf .enterCompilationScope ();
94
97
this .children [1 ].generateCode (mv , cf );
95
98
if (!CodeFlow .isPrimitive (this .exitTypeDescriptor )) {
96
99
CodeFlow .insertBoxIfNecessary (mv , cf .lastDescriptor ().charAt (0 ));
97
100
}
101
+ cf .exitCompilationScope ();
98
102
mv .visitLabel (endOfIf );
99
103
cf .pushDescriptor (this .exitTypeDescriptor );
100
104
}
0 commit comments