summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartok <martok@martoks-place.de>2023-08-09 22:41:30 +0200
committerMartok <martok@martoks-place.de>2023-08-09 22:41:30 +0200
commit3b32a66cb6c6cabf21b41ac4d5662f33ba1e80c3 (patch)
treed062a891b22700bb350e32b65cc2c7eedf59f060
parentedfb29e1a250167ea2c014991f2673f2d91db509 (diff)
downloaduxp-3b32a66cb6c6cabf21b41ac4d5662f33ba1e80c3.tar.gz
Issue #2172 - add null zone sanity checks
-rw-r--r--js/src/gc/Marking.cpp3
-rw-r--r--js/src/vm/Runtime.cpp3
2 files changed, 5 insertions, 1 deletions
diff --git a/js/src/gc/Marking.cpp b/js/src/gc/Marking.cpp
index 13ec5b0c05..1376df5a4d 100644
--- a/js/src/gc/Marking.cpp
+++ b/js/src/gc/Marking.cpp
@@ -788,7 +788,8 @@ ShouldMark<JSObject*>(GCMarker* gcmarker, JSObject* obj)
// Don't mark things outside a zone if we are in a per-zone GC. It is
// faster to check our own arena, which we can do since we know that
// the object is tenured.
- return obj->asTenured().zone()->shouldMarkInZone();
+ Zone* zone = obj->asTenured().zone();
+ return (zone && zone->shouldMarkInZone());
}
template <typename T>
diff --git a/js/src/vm/Runtime.cpp b/js/src/vm/Runtime.cpp
index ceb7a498b0..053b7c44b0 100644
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -877,6 +877,9 @@ js::CurrentThreadCanAccessRuntime(const JSRuntime* rt)
bool
js::CurrentThreadCanAccessZone(Zone* zone)
{
+ if (!zone)
+ return false;
+
if (CurrentThreadCanAccessRuntime(zone->runtime_))
return true;