Skip to content

Commit 8073dc0

Browse files
committed
Fix pickle creating bytes with empty storage
1 parent 2134f20 commit 8073dc0

File tree

1 file changed

+2
-2
lines changed
  • graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/pickle

1 file changed

+2
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/pickle/PicklerNodes.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,7 @@
5454
import static com.oracle.graal.python.nodes.statement.AbstractImportNode.importModule;
5555
import static com.oracle.graal.python.runtime.exception.PythonErrorType.AttributeError;
5656
import static com.oracle.graal.python.runtime.exception.PythonErrorType.TypeError;
57+
import static com.oracle.graal.python.util.PythonUtils.EMPTY_BYTE_ARRAY;
5758
import static com.oracle.graal.python.util.PythonUtils.TS_ENCODING;
5859
import static com.oracle.graal.python.util.PythonUtils.tsLiteral;
5960

@@ -106,7 +107,6 @@
106107
import com.oracle.graal.python.runtime.PythonContext;
107108
import com.oracle.graal.python.runtime.exception.PException;
108109
import com.oracle.graal.python.runtime.object.PythonObjectFactory;
109-
import com.oracle.graal.python.runtime.sequence.storage.EmptySequenceStorage;
110110
import com.oracle.graal.python.runtime.sequence.storage.SequenceStorage;
111111
import com.oracle.graal.python.util.PythonUtils;
112112
import com.oracle.truffle.api.CompilerDirectives;
@@ -391,7 +391,7 @@ protected Object decode(VirtualFrame frame, Object value, TruffleString encoding
391391

392392
protected Object escapeDecode(VirtualFrame frame, PythonObjectFactory factory, byte[] data, int offset, int len) {
393393
if (len == 0) {
394-
return factory.createBytes(EmptySequenceStorage.INSTANCE);
394+
return factory.createBytes(EMPTY_BYTE_ARRAY);
395395
}
396396
return escapeDecode(frame, PythonUtils.arrayCopyOfRange(data, offset, offset + len));
397397
}

0 commit comments

Comments
 (0)