Skip to content

Commit 797abed

Browse files
committed
(fix) NPE when loading constants in InterpretExpression
1 parent c50805d commit 797abed

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

src/main/java/com/googlecode/aviator/InterpretExpression.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ private void loadVars(final List<VariableMeta> vars) {
4747
}
4848

4949
private void loadConstants(final Set<Token<?>> constants, final List<IR> instruments) {
50-
InterpretContext ctx = new InterpretContext(this, instruments, getCompileEnv());
50+
final Env env = new Env();
51+
env.setInstance(this.instance);
52+
InterpretContext ctx = new InterpretContext(this, instruments, env);
5153
for (Token<?> token : constants) {
5254
final LoadIR loadConstantIR = new LoadIR(this.sourceFile, token, null, false);
5355
loadConstantIR.evalWithoutDispatch(ctx);

0 commit comments

Comments
 (0)