MCSnapshot.st
branchjv
changeset 1105 ae0f60d861ca
parent 1104 fc153ca7f02c
--- a/MCSnapshot.st	Mon Jun 29 23:15:01 2020 +0100
+++ b/MCSnapshot.st	Mon Jun 29 23:17:32 2020 +0100
@@ -32,6 +32,29 @@
 	^ self new initializeWithDefinitions: aCollection
 ! !
 
+!MCSnapshot methodsFor:'Compatibility-Squeak'!
+
+readDataFrom: aDataStream size: varsOnDisk
+    "/ Recent Pharo (8 and later) adds an extra instvar to
+    "/ MCSnapshot and MCMethodDefinition. The codePoint below
+    "/ just ignores the extra instvar, allowing us to read these
+    "/ .mcz. 
+    "/ 
+    "/ Whether this is a bug or another instance of
+    "/ 'nothing but Pharo matters' I do not know.
+    (self class instSize) == (varsOnDisk - 1) ifTrue:[ 
+        [ 
+            ^ super readDataFrom: aDataStream size: varsOnDisk
+        ] on: Error do:[:ex|
+            ex mayProceed ifTrue:[ 
+                ex proceed.
+            ].
+        ]
+    ].    
+    super readDataFrom: aDataStream size: varsOnDisk
+
+    "Created: / 29-06-2020 / 23:02:18 / Jan Vrany <jan.vrany@labware.com>"
+! !
 
 !MCSnapshot methodsFor:'accessing'!