-
-
Save toshok/a8edfebfe09da0d7bdaa to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
--- a/src/gc/collector.cpp | |
+++ b/src/gc/collector.cpp | |
@@ -231,12 +231,16 @@ void GCVisitor::visit(void* p) { | |
if (!p) | |
return; | |
- if (isNonheapRoot(p)) { | |
- return; | |
- } else { | |
- ASSERT(global_heap.getAllocationFromInteriorPointer(p)->user_data == p, "%p", p); | |
+ GCAllocation* alloc = global_heap.getAllocationFromInteriorPointer(p); | |
+ if (alloc) { | |
+ ASSERT(alloc->user_data == p, "%p", p); | |
stack->push(p); | |
} | |
+#ifndef NDEBUG | |
+ else { | |
+ ASSERT(isNonheapRoot(p), "%p", p); | |
+ } | |
+#endif | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment