Skip to content

Commit

Permalink
Reverse this change; objects will never report they are Integer.
Browse files Browse the repository at this point in the history
  • Loading branch information
headius committed Nov 17, 2016
1 parent 2d6d9f9 commit bed76e7
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 16 deletions.
26 changes: 12 additions & 14 deletions core/src/main/java/org/jruby/runtime/marshal/MarshalStream.java
Expand Up @@ -240,21 +240,19 @@ private void writeObjectData(IRubyObject value) throws IOException {
case FALSE:
write('F');
return;
case INTEGER:
if (value instanceof RubyFixnum) {
RubyFixnum fixnum = (RubyFixnum)value;

if (isMarshalFixnum(fixnum)) {
write('i');
writeInt((int) fixnum.getLongValue());
return;
}
// FIXME: inefficient; constructing a bignum just for dumping?
value = RubyBignum.newBignum(value.getRuntime(), fixnum.getLongValue());

// fall through
case FIXNUM:
RubyFixnum fixnum = (RubyFixnum)value;

if (isMarshalFixnum(fixnum)) {
write('i');
writeInt((int) fixnum.getLongValue());
return;
}

// FIXME: inefficient; constructing a bignum just for dumping?
value = RubyBignum.newBignum(value.getRuntime(), fixnum.getLongValue());

// fall through
case BIGNUM:
write('l');
RubyBignum.marshalTo((RubyBignum)value, this);
return;
Expand Down
4 changes: 2 additions & 2 deletions lib/pom.xml
Expand Up @@ -313,7 +313,7 @@ DO NOT MODIFIY - GENERATED CODE
<plugin>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-maven-plugin</artifactId>
<version>0.1.16</version>
<version>0.1.15</version>
<executions>
<execution>
<id>install_gems</id>
Expand Down Expand Up @@ -364,7 +364,7 @@ DO NOT MODIFIY - GENERATED CODE
<dependency>
<groupId>io.takari.polyglot</groupId>
<artifactId>polyglot-ruby</artifactId>
<version>0.1.16</version>
<version>0.1.15</version>
</dependency>
</dependencies>
</plugin>
Expand Down

0 comments on commit bed76e7

Please sign in to comment.