Browse Source

Fixed NPE in ScriptingExample due to nonpushing visitor not loaded

kindlich 5 years ago
parent
commit
bf1ecfacd3
No known key found for this signature in database

+ 2
- 2
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaExpressionVisitor.java View File

159
     private final JavaBoxingTypeVisitor boxingTypeVisitor;
159
     private final JavaBoxingTypeVisitor boxingTypeVisitor;
160
     private final JavaUnboxingTypeVisitor unboxingTypeVisitor;
160
     private final JavaUnboxingTypeVisitor unboxingTypeVisitor;
161
     private final JavaCapturedExpressionVisitor capturedExpressionVisitor = new JavaCapturedExpressionVisitor(this);
161
     private final JavaCapturedExpressionVisitor capturedExpressionVisitor = new JavaCapturedExpressionVisitor(this);
162
-    private final JavaBytecodeContext context;
163
-    private final JavaCompiledModule module;
162
+    final JavaBytecodeContext context;
163
+    final JavaCompiledModule module;
164
 
164
 
165
 	public JavaExpressionVisitor(JavaBytecodeContext context, JavaCompiledModule module, JavaWriter javaWriter) {
165
 	public JavaExpressionVisitor(JavaBytecodeContext context, JavaCompiledModule module, JavaWriter javaWriter) {
166
 		this.javaWriter = javaWriter;
166
 		this.javaWriter = javaWriter;

+ 4
- 3
JavaBytecodeCompiler/src/main/java/org/openzen/zenscript/javabytecode/compiler/JavaStatementVisitor.java View File

16
 public class JavaStatementVisitor implements StatementVisitor<Boolean> {
16
 public class JavaStatementVisitor implements StatementVisitor<Boolean> {
17
     private final JavaWriter javaWriter;
17
     private final JavaWriter javaWriter;
18
 	final JavaBytecodeContext context;
18
 	final JavaBytecodeContext context;
19
-    public JavaExpressionVisitor expressionVisitor;
20
-	public JavaNonPushingExpressionVisitor nonPushingExpressionVisitor;
19
+    public final JavaExpressionVisitor expressionVisitor;
20
+	public final JavaNonPushingExpressionVisitor nonPushingExpressionVisitor;
21
 
21
 
22
     /**
22
     /**
23
      * @param javaWriter the method writer that compiles the statement
23
      * @param javaWriter the method writer that compiles the statement
26
         this.javaWriter = javaWriter;
26
         this.javaWriter = javaWriter;
27
 		this.context = context;
27
 		this.context = context;
28
         this.expressionVisitor = new JavaExpressionVisitor(context, module, javaWriter);
28
         this.expressionVisitor = new JavaExpressionVisitor(context, module, javaWriter);
29
-		nonPushingExpressionVisitor = new JavaNonPushingExpressionVisitor(context, module, javaWriter, expressionVisitor);
29
+		this.nonPushingExpressionVisitor = new JavaNonPushingExpressionVisitor(context, module, javaWriter, expressionVisitor);
30
     }
30
     }
31
 
31
 
32
     public JavaStatementVisitor(JavaBytecodeContext context, JavaExpressionVisitor expressionVisitor) {
32
     public JavaStatementVisitor(JavaBytecodeContext context, JavaExpressionVisitor expressionVisitor) {
33
         this.javaWriter = expressionVisitor.getJavaWriter();
33
         this.javaWriter = expressionVisitor.getJavaWriter();
34
 		this.context = context;
34
 		this.context = context;
35
         this.expressionVisitor = expressionVisitor;
35
         this.expressionVisitor = expressionVisitor;
36
+		this.nonPushingExpressionVisitor = new JavaNonPushingExpressionVisitor(expressionVisitor.context, expressionVisitor.module, expressionVisitor.javaWriter, expressionVisitor);
36
     }
37
     }
37
 
38
 
38
 	@Override
39
 	@Override

Loading…
Cancel
Save