0
0
Fork 0
mirror of https://github.com/denoland/rusty_v8.git synced 2024-11-21 15:04:33 -05:00

fix: 32-bit build fails on non-size_t based size assertions (#1289)

This commit is contained in:
Aapo Alasuutari 2023-07-27 16:10:17 +03:00 committed by GitHub
parent 1d6988942b
commit 715060df6e
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -65,10 +65,6 @@ static_assert(sizeof(v8::ReturnValue<v8::Value>) == sizeof(size_t) * 1,
static_assert(sizeof(v8::TryCatch) == sizeof(size_t) * 6, static_assert(sizeof(v8::TryCatch) == sizeof(size_t) * 6,
"TryCatch size mismatch"); "TryCatch size mismatch");
static_assert(sizeof(v8::Isolate::DisallowJavascriptExecutionScope) ==
sizeof(size_t) * 2,
"DisallowJavascriptExecutionScope size mismatch");
static_assert(sizeof(v8::Isolate::AllowJavascriptExecutionScope) == static_assert(sizeof(v8::Isolate::AllowJavascriptExecutionScope) ==
sizeof(size_t) * 2, sizeof(size_t) * 2,
"AllowJavascriptExecutionScope size mismatch"); "AllowJavascriptExecutionScope size mismatch");
@ -96,6 +92,9 @@ static_assert(offsetof(v8::ScriptCompiler::CachedData, rejected) == 12,
"CachedData.rejected offset mismatch"); "CachedData.rejected offset mismatch");
static_assert(offsetof(v8::ScriptCompiler::CachedData, buffer_policy) == 16, static_assert(offsetof(v8::ScriptCompiler::CachedData, buffer_policy) == 16,
"CachedData.buffer_policy offset mismatch"); "CachedData.buffer_policy offset mismatch");
static_assert(sizeof(v8::Isolate::DisallowJavascriptExecutionScope) ==
16,
"DisallowJavascriptExecutionScope size mismatch");
#else #else
static_assert(sizeof(v8::ScriptCompiler::CachedData) == 16, static_assert(sizeof(v8::ScriptCompiler::CachedData) == 16,
"CachedData size mismatch"); "CachedData size mismatch");
@ -107,6 +106,9 @@ static_assert(offsetof(v8::ScriptCompiler::CachedData, rejected) == 8,
"CachedData.rejected offset mismatch"); "CachedData.rejected offset mismatch");
static_assert(offsetof(v8::ScriptCompiler::CachedData, buffer_policy) == 12, static_assert(offsetof(v8::ScriptCompiler::CachedData, buffer_policy) == 12,
"CachedData.buffer_policy offset mismatch"); "CachedData.buffer_policy offset mismatch");
static_assert(sizeof(v8::Isolate::DisallowJavascriptExecutionScope) ==
12,
"DisallowJavascriptExecutionScope size mismatch");
#endif #endif
extern "C" { extern "C" {
@ -1030,12 +1032,12 @@ class ExternalConstOneByteStringResource
public: public:
ExternalConstOneByteStringResource(int length) ExternalConstOneByteStringResource(int length)
: _length(length) { : _length(length) {
static_assert(offsetof(ExternalConstOneByteStringResource, _length) == 16, static_assert(offsetof(ExternalConstOneByteStringResource, _length) == sizeof(size_t) * 2,
"ExternalConstOneByteStringResource's length was not at offset 16"); "ExternalConstOneByteStringResource's length was not at offset of sizeof(size_t) * 2");
static_assert(sizeof(ExternalConstOneByteStringResource) == 24, static_assert(sizeof(ExternalConstOneByteStringResource) == sizeof(size_t) * 3,
"ExternalConstOneByteStringResource size was not 24"); "ExternalConstOneByteStringResource size was not sizeof(size_t) * 3");
static_assert(alignof(ExternalConstOneByteStringResource) == 8, static_assert(alignof(ExternalConstOneByteStringResource) == sizeof(size_t),
"ExternalConstOneByteStringResource align was not 8"); "ExternalConstOneByteStringResource align was not sizeof(size_t)");
} }
const char* data() const override { return nullptr; } const char* data() const override { return nullptr; }
size_t length() const override { return _length; } size_t length() const override { return _length; }