mirror of
https://github.com/denoland/rusty_v8.git
synced 2025-01-22 06:09:47 -05:00
Fix bad assumption in static_assert (#668)
v8::Location is the size of two ints, not the size of one size_t. `2 * sizeof(int) == sizeof(size_t)` on 64 bits architectures but not on 32 bits architectures. Fixes #667.
This commit is contained in:
parent
2f7809ffe9
commit
84f1241b68
2 changed files with 2 additions and 2 deletions
|
@ -52,7 +52,7 @@ 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::Location) == sizeof(size_t) * 1,
|
static_assert(sizeof(v8::Location) == sizeof(int) * 2,
|
||||||
"Location size mismatch");
|
"Location size mismatch");
|
||||||
|
|
||||||
static_assert(sizeof(v8::SnapshotCreator) == sizeof(size_t) * 1,
|
static_assert(sizeof(v8::SnapshotCreator) == sizeof(size_t) * 1,
|
||||||
|
|
|
@ -195,7 +195,7 @@ extern "C" {
|
||||||
/// A location in JavaScript source.
|
/// A location in JavaScript source.
|
||||||
#[repr(C)]
|
#[repr(C)]
|
||||||
#[derive(Debug)]
|
#[derive(Debug)]
|
||||||
pub struct Location([usize; 1]);
|
pub struct Location([i32; 2]);
|
||||||
|
|
||||||
impl Location {
|
impl Location {
|
||||||
pub fn get_line_number(&self) -> int {
|
pub fn get_line_number(&self) -> int {
|
||||||
|
|
Loading…
Add table
Reference in a new issue