Author: Matti Picus <[email protected]>
Branch: 
Changeset: r96388:a93dfb333afe
Date: 2019-03-31 15:15 +0300
http://bitbucket.org/pypy/pypy/changeset/a93dfb333afe/

Log:    preserve order on extra effects (sets are not ordered on cpython2)

diff --git a/rpython/jit/codewriter/effectinfo.py 
b/rpython/jit/codewriter/effectinfo.py
--- a/rpython/jit/codewriter/effectinfo.py
+++ b/rpython/jit/codewriter/effectinfo.py
@@ -326,14 +326,17 @@
         # a read or a write to an interiorfield, inside an array of
         # structs, is additionally recorded as a read or write of
         # the array itself
-        extraef = set()
+        extraef = list()
         for tup in effects:
             if tup[0] == "interiorfield" or tup[0] == "readinteriorfield":
                 T = deref(tup[1])
                 if isinstance(T, lltype.Array) and consider_array(T):
-                    extraef.add((tup[0].replace("interiorfield", "array"),
-                                 tup[1]))
-        effects |= extraef
+                    val = (tup[0].replace("interiorfield", "array"),
+                                 tup[1])
+                    if val not in effects:
+                        extraef.append(val)
+        # preserve order in the added effects issue bitbucket #2984
+        effects = tuple(effects) + tuple(extraef)
 
         for tup in effects:
             if tup[0] == "struct":
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to