Skip to content
Permalink
Browse files
Fix 1.8 symbol compilation after encoding change. Fixes #2307.
  • Loading branch information
headius committed Dec 11, 2014
1 parent a80096f commit 81879f19867d8bb11bacf41e617ba9f5c5ac16b2
Showing with 10 additions and 2 deletions.
  1. +10 −2 core/src/main/java/org/jruby/compiler/impl/InheritedCacheCompiler.java
@@ -169,12 +169,20 @@ public void cacheSymbol(BaseBodyCompiler method, String symbol, Encoding encodin
method.loadThreadContext();
if (index < AbstractScript.NUMBERED_SYMBOL_COUNT) {
method.method.ldc(symbol);
method.method.ldc(encoding.toString());
if (encoding == null) {
method.method.aconst_null();
} else {
method.method.ldc(encoding.toString());
}
method.method.invokevirtual(scriptCompiler.getClassname(), "getSymbol" + index, sig(RubySymbol.class, ThreadContext.class, String.class, String.class));
} else {
method.method.ldc(index.intValue());
method.method.ldc(symbol);
method.method.ldc(encoding.toString());
if (encoding == null) {
method.method.aconst_null();
} else {
method.method.ldc(encoding.toString());
}
method.method.invokevirtual(scriptCompiler.getClassname(), "getSymbol", sig(RubySymbol.class, ThreadContext.class, int.class, String.class, String.class));
}
}

0 comments on commit 81879f1

Please sign in to comment.