Skip to content

Commit 7b08673

Browse files
committed
More non-null assertions in spaces.
1 parent dbf6e94 commit 7b08673

File tree

5 files changed

+5
-0
lines changed

5 files changed

+5
-0
lines changed

src/policy/copyspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -217,6 +217,7 @@ impl<VM: VMBinding> CopySpace<VM> {
217217
worker: &mut GCWorker<VM>,
218218
) -> ObjectReference {
219219
trace!("copyspace.trace_object(, {:?}, {:?})", object, semantics,);
220+
debug_assert!(!object.is_null());
220221

221222
// If this is not from space, we do not need to trace it (the object has been copied to the tosapce)
222223
if !self.is_from_space() {

src/policy/immix/immixspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ impl<VM: VMBinding> crate::policy::gc_work::PolicyTraceObject<VM> for ImmixSpace
184184
copy: Option<CopySemantics>,
185185
worker: &mut GCWorker<VM>,
186186
) -> ObjectReference {
187+
debug_assert!(!object.is_null());
187188
if KIND == TRACE_KIND_TRANSITIVE_PIN {
188189
self.trace_object_without_moving(queue, object)
189190
} else if KIND == TRACE_KIND_DEFRAG {

src/policy/immortalspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -187,6 +187,7 @@ impl<VM: VMBinding> ImmortalSpace<VM> {
187187
queue: &mut Q,
188188
object: ObjectReference,
189189
) -> ObjectReference {
190+
debug_assert!(!object.is_null());
190191
#[cfg(feature = "vo_bit")]
191192
debug_assert!(
192193
crate::util::metadata::vo_bit::is_vo_bit_set::<VM>(object),

src/policy/largeobjectspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,7 @@ impl<VM: VMBinding> LargeObjectSpace<VM> {
189189
queue: &mut Q,
190190
object: ObjectReference,
191191
) -> ObjectReference {
192+
debug_assert!(!object.is_null());
192193
#[cfg(feature = "vo_bit")]
193194
debug_assert!(
194195
crate::util::metadata::vo_bit::is_vo_bit_set::<VM>(object),

src/policy/markcompactspace.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -130,6 +130,7 @@ impl<VM: VMBinding> crate::policy::gc_work::PolicyTraceObject<VM> for MarkCompac
130130
_copy: Option<CopySemantics>,
131131
_worker: &mut GCWorker<VM>,
132132
) -> ObjectReference {
133+
debug_assert!(!object.is_null());
133134
debug_assert!(
134135
KIND != TRACE_KIND_TRANSITIVE_PIN,
135136
"MarkCompact does not support transitive pin trace."

0 commit comments

Comments
 (0)