diff options
author | Michaël Zasso <targos@protonmail.com> | 2019-03-30 15:21:31 +0100 |
---|---|---|
committer | Michaël Zasso <targos@protonmail.com> | 2019-04-03 08:29:25 +0200 |
commit | 5b8434eebceb7a60062bbebc03cdf83d520c6bee (patch) | |
tree | 26a9a211a33a7d697431e197dc6c3d9e07cb7f44 /deps/v8/src/objects/bigint.h | |
parent | 8cc181c8eeb724d4ce0613fcc515857681bddbe9 (diff) | |
download | node-new-5b8434eebceb7a60062bbebc03cdf83d520c6bee.tar.gz |
deps: V8: cherry-pick 0188634
Original commit message:
[ptr-compr][ubsan] Use [Read/Write]UnalignedValue for unaligned fields
When pointer compression is enabled the [u]intptr_t and double fields are
only kTaggedSize aligned so in order to avoid undefined behavior in C++ code
we have to access these values in an unaligned pointer friendly way although
both x64 and arm64 architectures (where pointer compression is supported)
allow unaligned access.
These changes will be removed once v8:8875 is fixed and all the
kSystemPointerSize fields are properly aligned.
Bug: v8:7703
Change-Id: I4df477cbdeab806303bb4f675d52b61c06342c8e
Reviewed-on: https://chromium-review.googlesource.com/c/v8/v8/+/1528996
Commit-Queue: Igor Sheludko <ishell@chromium.org>
Reviewed-by: Ulan Degenbaev <ulan@chromium.org>
Reviewed-by: Jakob Gruber <jgruber@chromium.org>
Reviewed-by: Clemens Hammacher <clemensh@chromium.org>
Cr-Commit-Position: refs/heads/master@{#60321}
Refs: https://github.com/v8/v8/commit/0188634ee523aef39ba71732b1ab9d422f449825
PR-URL: https://github.com/nodejs/node/pull/27013
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Gus Caplan <me@gus.host>
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Ben Noordhuis <info@bnoordhuis.nl>
Diffstat (limited to 'deps/v8/src/objects/bigint.h')
-rw-r--r-- | deps/v8/src/objects/bigint.h | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/deps/v8/src/objects/bigint.h b/deps/v8/src/objects/bigint.h index ae1ffe6866..4ddb57a5b2 100644 --- a/deps/v8/src/objects/bigint.h +++ b/deps/v8/src/objects/bigint.h @@ -87,8 +87,7 @@ class BigIntBase : public HeapObject { inline digit_t digit(int n) const { SLOW_DCHECK(0 <= n && n < length()); - Address address = FIELD_ADDR(*this, kDigitsOffset + n * kDigitSize); - return *reinterpret_cast<digit_t*>(address); + return READ_UINTPTR_FIELD(*this, kDigitsOffset + n * kDigitSize); } bool is_zero() const { return length() == 0; } |