Skip to content

Commit

Permalink
Showing 1 changed file with 4 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -12,10 +12,13 @@
import com.oracle.truffle.api.CompilerDirectives.TruffleBoundary;
import com.oracle.truffle.api.dsl.Specialization;
import com.oracle.truffle.api.object.DynamicObject;
import org.jcodings.specific.ASCIIEncoding;
import org.jruby.RubyRandom;
import org.jruby.truffle.Layouts;
import org.jruby.truffle.builtins.Primitive;
import org.jruby.truffle.builtins.PrimitiveArrayArgumentsNode;
import org.jruby.truffle.core.rope.CodeRange;
import org.jruby.truffle.core.rope.RopeOperations;
import org.jruby.util.ByteList;
import org.jruby.util.Random;

@@ -130,7 +133,7 @@ public DynamicObject genRandBytes(DynamicObject randomizer, int length) {
r >>>= 8;
}
}
return createString(new ByteList(bytes));
return createString(RopeOperations.create(bytes, ASCIIEncoding.INSTANCE, CodeRange.CR_UNKNOWN));
}
}

0 comments on commit 784e34b

Please sign in to comment.