Open Bug 904303 Opened 11 years ago Updated 2 years ago

Make compartment-checking "work" (that is, do same-runtime checks) on atoms and atom-valued jsids

Categories

(Core :: JavaScript Engine, defect)

defect

Tracking

()

People

(Reporter: Waldo, Unassigned)

References

(Blocks 1 open bug)

Details

(Whiteboard: [lang=c++])

Apparently right now the only thing we do when compartment-checking a jsid, is check that it's right *if it's an object* (which no jsid ever is, in this enlightened post-E4X era).  We should also "compartment-check" atom-valued ids, by which we mean we should make sure they exist in the runtime (atoms being per-runtime, not per-compartment or per-zone or anything).

We'd want to change CompartmentChecker::check(jsid) to forward to CompartmentChecker::check(JSString*), then we'd want to change that do to a correct-runtime check on atoms (which currently go untested in that method), something like str->compartment()->runtimeFromAnyThread() == compartment->runtimeFromMainThread() in concert with a copy of the printf/MOZ_CRASH in CompartmentChecker::fail.  A fairly easy patch, someone with time just needs to do it.
Assignee: general → nobody
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.