Skip to content

Commit eab53ac

Browse files
committed
Fix MRO lookup in presence of side effecting dicts
1 parent 72dfb19 commit eab53ac

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/modules/SysModuleBuiltins.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -611,7 +611,7 @@ public void postInitialize0(Python3Core core) {
611611
}
612612
sys.setAttribute(tsLiteral("dont_write_bytecode"), context.getOption(PythonOptions.DontWriteBytecodeFlag));
613613
TruffleString pycachePrefix = context.getOption(PythonOptions.PyCachePrefix);
614-
if (pycachePrefix.isEmpty() && PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER) {
614+
if (pycachePrefix.isEmpty() && PythonOptions.ENABLE_BYTECODE_DSL_INTERPRETER && System.getenv("CI") == null) {
615615
pycachePrefix = PythonUtils.toTruffleStringUncached("__bci_dsl_pycache__");
616616
}
617617
sys.setAttribute(tsLiteral("pycache_prefix"), pycachePrefix.isEmpty() ? PNone.NONE : pycachePrefix);

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/HashingStorageNodes.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ public static boolean mayHaveSideEffectingEq(HashingStorage storage) {
122122

123123
public static boolean mayHaveSideEffects(PHashingCollection wrapper) {
124124
HashingStorage s = wrapper.getDictStorage();
125-
return !(s instanceof EconomicMapStorage && ((EconomicMapStorage) s).map.hasSideEffectingKeys());
125+
return s instanceof EconomicMapStorage && ((EconomicMapStorage) s).map.hasSideEffectingKeys();
126126
}
127127
}
128128

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/common/ObjectHashMap.java

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -628,6 +628,8 @@ public static void doPutWithRestart(Frame frame, Node inliningTarget, ObjectHash
628628
@Cached InlinedBranchProfile rehash1Profile,
629629
@Cached InlinedBranchProfile rehash2Profile,
630630
@Cached PyObjectRichCompareBool eqNode) {
631+
// If this assert fires: you're probably using PutUnsafeNode, but should use PutNode
632+
assert map.hasSideEffectingKeys || (!IsSideEffectingKeyNodeGen.getUncached().execute(null, key));
631633
while (true) {
632634
try {
633635
doPut(frame, map, key, keyHash, value, inliningTarget, foundNullKey, foundEqKey,

0 commit comments

Comments
 (0)