When testing /c/mozilla/js/tests/e4x/Expressions/11.1.4-04.js, I discovered that ParseNodeToXML() has two early exits like this: return PN2X_SKIP_CHILD; without calling js_LeaveLocalRootScopeWithResult(). This leaves the local root stack created during function entry active. When doing a for...each loop, this leads to the entire global object still being rooted (in jsinterp.c, the PropertyIterator's parent is rooted) - causing a massive memory leak, especially if multiple global objects are used.
Created attachment 214780 [details] [diff] [review] Goto end of function and leave correctly. Instead of returning early, jump to the end of the function, call js_LeaveLocalRootScope() and then return.
Comment on attachment 214780 [details] [diff] [review] Goto end of function and leave correctly. I can't find any obvious way to combine the two common return paths, so r=mrbkap.
Comment on attachment 214780 [details] [diff] [review] Goto end of function and leave correctly. >+skipChild: >+ js_LeaveLocalRootScope(cx); >+ return PN2X_SKIP_CHILD; >+ Esoteric code style rule (see bug 328896 comment 2) favors skip_child style for label names. Thanks for finding and fixing this! /be
It took me quite a fwhile to track this one down :) Changed label name from skipChild to ckip_skild and committed the fix (3.92).
*** Bug 330857 has been marked as a duplicate of this bug. ***
To whoever evaluates this for inclusion into 184.108.40.206: please see bug 330857 (dupe of this) for the real-world effect this bug is having.
Yeah, this is a no-brainer for 220.127.116.11. /be
re comment 0-> already a test available.
This needs to get landed for FF18.104.22.168. Brendan, blake, daumling can you get this landed?
Comment on attachment 214780 [details] [diff] [review] Goto end of function and leave correctly. I *think* I'm allowed to do this -- it's approved for 1.8.0 anyway!
Fixed on the 1.8 branches.
Even though this bug was discovered with an existing test case, the actual test does not cover the particulars of this bug. For that reason -> in-testsuite-