зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1694685 part 1 - Add static_assert for JSPropertySpec size. r=tcampbell
There are multiple (nested) unions so the size isn't obvious. Adding a sanity check helps catch regressions. Differential Revision: https://phabricator.services.mozilla.com/D106406
This commit is contained in:
Родитель
30d171d273
Коммит
8fed47db9b
|
@ -339,6 +339,14 @@ struct JSPropertySpec {
|
|||
}
|
||||
};
|
||||
|
||||
// There can be many JSPropertySpec instances so verify the size is what we
|
||||
// expect:
|
||||
//
|
||||
// - Name (1 word)
|
||||
// - Flags (1 word)
|
||||
// - AccessorsOrValue (4 words, native + JSJitInfo for both getter and setter)
|
||||
static_assert(sizeof(JSPropertySpec) == 6 * sizeof(uintptr_t));
|
||||
|
||||
#define JS_CHECK_ACCESSOR_FLAGS(flags) \
|
||||
(static_cast<std::enable_if_t<((flags) & ~(JSPROP_ENUMERATE | \
|
||||
JSPROP_PERMANENT)) == 0>>(0), \
|
||||
|
|
Загрузка…
Ссылка в новой задаче