Skip to content

Commit 40808ce

Browse files
committed
fix conflict
1 parent 2b5fb63 commit 40808ce

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

graalpython/com.oracle.graal.python/src/com/oracle/graal/python/builtins/objects/cext/DynamicObjectNativeWrapper.java

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -514,13 +514,14 @@ Object doTpRepr(PythonManagedClass object, @SuppressWarnings("unused") String ke
514514
return toSulongNode.execute(lookupAttrNode.execute(object, __REPR__));
515515
}
516516

517-
@Specialization(guards = "eq(TP_DICT, key)")
517+
@Specialization(guards = "eq(TP_DICT, key)", limit = "1")
518518
Object doTpDict(PythonManagedClass object, @SuppressWarnings("unused") String key,
519519
@Cached PythonObjectFactory factory,
520+
@CachedLibrary("object") PythonObjectLibrary lib,
520521
@Shared("toSulongNode") @Cached CExtNodes.ToSulongNode toSulongNode,
521-
@Cached(value = "createEquivalence()", uncached = "getSlowPathEquivalence()") Equivalence equivalence) {
522+
@Cached(value = "createEquivalence()", uncached = "getSlowPathEquivalence()") Equivalence equivalence) throws UnsupportedMessageException {
522523
// TODO(fa): we could cache the dict instance on the class' native wrapper
523-
PHashingCollection dict = object.getDict();
524+
PHashingCollection dict = lib.getDict(object);
524525
HashingStorage dictStorage = dict != null ? dict.getDictStorage() : null;
525526
if (dictStorage instanceof PythonObjectHybridDictStorage) {
526527
// reuse the existing and modifiable storage
@@ -531,7 +532,7 @@ Object doTpDict(PythonManagedClass object, @SuppressWarnings("unused") String ke
531532
// copy all mappings to the new storage
532533
storage.addAll(dictStorage, equivalence);
533534
}
534-
object.setDict(factory.createMappingproxy(storage));
535+
lib.setDict(object, factory.createMappingproxy(storage));
535536
return toSulongNode.execute(factory.createDict(storage));
536537
}
537538

0 commit comments

Comments
 (0)