denoland / rusty_v8

Rust bindings for the V8 JavaScript engine
https://crates.io/crates/v8
MIT License
3.08k stars 299 forks source link

fix: fix size checking on 32-bit platforms #1489

Closed liushuyu closed 1 month ago

liushuyu commented 1 month ago

This pull request fixes the type size checking on 32-bit platforms in src/binding.cpp.

On 32-bit platforms like armv7 or ppc32, the size of v8::ScriptCompiler::CompilationDetails and v8::ScriptCompiler::Source will be different than currently expected. This is due to how those 32-bit platforms lay out the 64-bit elements in a structure.

You can see a reduced example on Compiler Explorer: https://godbolt.org/z/TG1bPGG8n.

CLAassistant commented 1 month ago

CLA assistant check
All committers have signed the CLA.