From f3bcf0db2882e28e724b8636906a321dc5f3c8b2 Mon Sep 17 00:00:00 2001
From: Mick Jordan <mick.jordan@oracle.com>
Date: Sun, 13 Mar 2016 18:44:25 -0700
Subject: [PATCH] fix bad merge

---
 .../builtin/base/HiddenInternalFunctions.java | 20 +++++++++----------
 1 file changed, 10 insertions(+), 10 deletions(-)

diff --git a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
index ed3a128b99..7de3cd00ce 100644
--- a/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
+++ b/com.oracle.truffle.r.nodes.builtin/src/com/oracle/truffle/r/nodes/builtin/base/HiddenInternalFunctions.java
@@ -344,16 +344,16 @@ public class HiddenInternalFunctions {
 
         @Override
         protected void createCasts(CastBuilder casts) {
-            casts.toInteger(3);
+            casts.toInteger(2).toInteger(3);
         }
 
         @Specialization
-        protected RIntVector lazyLoadDBinsertValue(VirtualFrame frame, Object value, RAbstractStringVector file, byte asciiL, int compression, RFunction hook) {
+        protected RIntVector lazyLoadDBinsertValue(VirtualFrame frame, Object value, RAbstractStringVector file, int asciiL, int compression, RFunction hook) {
             return lazyLoadDBinsertValueInternal(frame.materialize(), value, file, asciiL, compression, hook);
         }
 
         @TruffleBoundary
-        private RIntVector lazyLoadDBinsertValueInternal(MaterializedFrame frame, Object value, RAbstractStringVector file, byte asciiL, int compression, RFunction hook) {
+        private RIntVector lazyLoadDBinsertValueInternal(MaterializedFrame frame, Object value, RAbstractStringVector file, int type, int compression, RFunction hook) {
             if (!(compression == 1 || compression == 3)) {
                 throw RError.error(this, Message.GENERIC, "unsupported compression");
             }
@@ -366,27 +366,27 @@ public class HiddenInternalFunctions {
             };
 
             try {
-                byte[] data = RSerialize.serialize(value, RRuntime.fromLogical(asciiL), false, RSerialize.DEFAULT_VERSION, callHook);
+                byte[] data = RSerialize.serialize(value, type, RSerialize.DEFAULT_VERSION, callHook);
                 // See comment in LazyLoadDBFetch for format
                 int outLen;
                 int offset;
-                RCompression.Type type;
+                RCompression.Type ctype;
                 byte[] cdata;
                 if (compression == 1) {
-                    type = RCompression.Type.GZIP;
+                    ctype = RCompression.Type.GZIP;
                     offset = 4;
                     outLen = (int) (1.001 * data.length) + 20;
                     cdata = new byte[outLen];
-                    boolean rc = RCompression.compress(type, data, cdata);
+                    boolean rc = RCompression.compress(ctype, data, cdata);
                     if (!rc) {
                         throw RError.error(this, Message.GENERIC, "zlib compress error");
                     }
                 } else if (compression == 3) {
-                    type = RCompression.Type.LZMA;
+                    ctype = RCompression.Type.LZMA;
                     offset = 5;
                     outLen = data.length;
                     cdata = new byte[outLen];
-                    boolean rc = RCompression.compress(type, data, cdata);
+                    boolean rc = RCompression.compress(ctype, data, cdata);
                     if (!rc) {
                         throw RError.error(this, Message.GENERIC, "lzma compress error");
                     }
@@ -395,7 +395,7 @@ public class HiddenInternalFunctions {
                 }
                 int[] intData = new int[2];
                 intData[1] = outLen + offset; // include length + type (compression == 3)
-                intData[0] = appendFile(file.getDataAt(0), cdata, data.length, type);
+                intData[0] = appendFile(file.getDataAt(0), cdata, data.length, ctype);
                 return RDataFactory.createIntVector(intData, RDataFactory.COMPLETE_VECTOR);
             } catch (Throwable ex) {
                 // Exceptions have been observed that were masked and very hard to find
-- 
GitLab