Skip to content

Commit 41a41d4

Browse files
authored
Merge pull request #61 from ruby/assert-pin-object-not-moved
Assert pinning object is not moved
2 parents dd19f10 + 8813e76 commit 41a41d4

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

gc/mmtk/src/pinning_registry.rs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,11 @@ impl GCWork<Ruby> for PinPinningChildren {
110110
target_object
111111
);
112112
if pin {
113+
debug_assert!(
114+
target_object.get_forwarded_object().is_none(),
115+
"Trying to pin {target_object} but has been moved"
116+
);
117+
113118
pinned_objs.push(target_object);
114119
}
115120
target_object

0 commit comments

Comments
 (0)