version was not initialized properly
diff --git a/Python/marshal.c b/Python/marshal.c
index 1962f92..ff8247c 100644
--- a/Python/marshal.c
+++ b/Python/marshal.c
@@ -1035,6 +1035,7 @@
 	wf.error = 0;
 	wf.depth = 0;
 	wf.strings = (version > 0) ? PyDict_New() : 0;
+	wf.version = version;
 	w_object(x, &wf);
 	Py_XDECREF(wf.strings);
 	if (wf.error) {