Check type compatibility when coercing RootedVar to Handle, bug 745361. r=luke
authorBrian Hackett <bhackett1024@gmail.com>
Sun, 15 Apr 2012 21:19:44 -0700
changeset 95054 4597dcf0842ab6040039ca3c7eeab126a341ec98
parent 95053 eae5257fcacad0b75ced5964aa65b51e68d0acea
child 95055 67ca169a52d24cb370ebb01bc03eb16dc8453652
push id886
push userlsblakk@mozilla.com
push dateMon, 04 Jun 2012 19:57:52 +0000
treeherdermozilla-beta@bbd8d5efd6d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke
bugs745361
milestone14.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Check type compatibility when coercing RootedVar to Handle, bug 745361. r=luke
js/src/gc/Root.h
--- a/js/src/gc/Root.h
+++ b/js/src/gc/Root.h
@@ -329,16 +329,17 @@ class RootedVar
     RootedVar() MOZ_DELETE;
     RootedVar(const RootedVar &) MOZ_DELETE;
 };
 
 template <typename T> template <typename S>
 inline
 Handle<T>::Handle(const RootedVar<S> &root)
 {
+    testAssign<S>();
     ptr = reinterpret_cast<const T *>(root.address());
 }
 
 typedef RootedVar<JSObject*>    RootedVarObject;
 typedef RootedVar<JSFunction*>  RootedVarFunction;
 typedef RootedVar<JSString*>    RootedVarString;
 typedef RootedVar<jsid>         RootedVarId;
 typedef RootedVar<Value>        RootedVarValue;