Permalink
Browse files

fix bug in jvm bytecode compiler

  • Loading branch information...
1 parent c73beca commit 58977b58c5e568ca6948ff27fc3e05acf36bca87 @krestenkrab krestenkrab committed Dec 15, 2009
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/main/java/erjang/beam/CompilerVisitor.java
@@ -1748,9 +1748,9 @@ public void visitTest(BeamOpcode test, int failLabel, Arg arg,
switch (test) {
case test_arity: {
Type tt = getTubleType(arity);
- push(arg, ETUPLE_TYPE);
+ push(arg, EOBJECT_TYPE);
mv.visitMethodInsn(INVOKESTATIC, tt.getInternalName(),
- "cast", "(" + ETUPLE_DESC + ")"
+ "cast", "(" + arg.type.getDescriptor() + ")"
+ tt.getDescriptor());
mv.visitInsn(DUP);

1 comment on commit 58977b5

@krestenkrab
Member

If arg cannot be inferred to be of type ETuple, we should perhaps insert the dynamic test for ETuple as a special case here.

Please sign in to comment.