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.
@@ -79,10 +79,12 @@ public boolean isCompilable() {
79
79
public void generateCode (MethodVisitor mv , CodeFlow cf ) {
80
80
// exit type descriptor can be null if both components are literal expressions
81
81
computeExitTypeDescriptor ();
82
+ cf .enterCompilationScope ();
82
83
this .children [0 ].generateCode (mv , cf );
83
84
String lastDesc = cf .lastDescriptor ();
84
85
Assert .state (lastDesc != null , "No last descriptor" );
85
86
CodeFlow .insertBoxIfNecessary (mv , lastDesc .charAt (0 ));
87
+ cf .exitCompilationScope ();
86
88
Label elseTarget = new Label ();
87
89
Label endOfIf = new Label ();
88
90
mv .visitInsn (DUP );
@@ -95,12 +97,14 @@ public void generateCode(MethodVisitor mv, CodeFlow cf) {
95
97
mv .visitJumpInsn (IFEQ , endOfIf ); // if not empty, drop through to elseTarget
96
98
mv .visitLabel (elseTarget );
97
99
mv .visitInsn (POP );
100
+ cf .enterCompilationScope ();
98
101
this .children [1 ].generateCode (mv , cf );
99
102
if (!CodeFlow .isPrimitive (this .exitTypeDescriptor )) {
100
103
lastDesc = cf .lastDescriptor ();
101
104
Assert .state (lastDesc != null , "No last descriptor" );
102
105
CodeFlow .insertBoxIfNecessary (mv , lastDesc .charAt (0 ));
103
106
}
107
+ cf .exitCompilationScope ();
104
108
mv .visitLabel (endOfIf );
105
109
cf .pushDescriptor (this .exitTypeDescriptor );
106
110
}
0 commit comments