Closed Bug 839485 Opened 11 years ago Closed 11 years ago

GC: Root a couple of rooting issues in jsapi tests

Categories

(Core :: JavaScript Engine, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED DUPLICATE of bug 838014

People

(Reporter: jonco, Unassigned)

Details

Attachments

(1 file)

Attached patch Proposed fixSplinter Review
Fix for some issues in jsapi tests found by static analysis.
Attachment #711832 - Flags: review?(sphink)
Comment on attachment 711832 [details] [diff] [review]
Proposed fix

Review of attachment 711832 [details] [diff] [review]:
-----------------------------------------------------------------

Sorry, this was another collision. I finally managed to land my rooting in jsapi-tests, and after rebasing on top of that, there are only two things left in this patch. I'll just comment on those. (This was from just before we started using the etherpad.)

::: js/src/jsapi-tests/testArrayBuffer.cpp
@@ +160,5 @@
>  
>      return true;
>  }
>  
> +bool isNeutered(JSContext *cx, JS::HandleObject obj) {

isNeutered runs as a method of a test object, and that object has a local 'cx' variable, so this isn't needed.

::: js/src/jsapi-tests/tests.h
@@ +183,5 @@
>          if (!checkEqual(actual, expected, #actual, #expected, __FILE__, __LINE__)) \
>              return false; \
>      } while (false)
>  
> +    bool checkSame(jsval actual, jsval expectedArg,

I avoided rooting when a test was going to fail anyway (by putting an AutoSuppressGC in fail().) So this ended up slightly different.
Attachment #711832 - Flags: review?(sphink)
Status: NEW → RESOLVED
Closed: 11 years ago
Resolution: --- → DUPLICATE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: