Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(271)

Unified Diff: runtime/vm/object.cc

Issue 2947783002: Avoid unaligned access fault in Int32x4/Float32x4::value() on ARM. (Closed)
Patch Set: . Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « runtime/vm/object.h ('k') | tests/lib/typed_data/float32x4_test.dart » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: runtime/vm/object.cc
diff --git a/runtime/vm/object.cc b/runtime/vm/object.cc
index 728e2ffe6446a8833d056194b9aef8d727408440..f0ed3ff04efa33a533dc6d549ba22f214913bc29 100644
--- a/runtime/vm/object.cc
+++ b/runtime/vm/object.cc
@@ -22352,12 +22352,14 @@ RawFloat32x4* Float32x4::New(simd128_value_t value, Heap::Space space) {
simd128_value_t Float32x4::value() const {
- return simd128_value_t().readFrom(&raw_ptr()->value_[0]);
+ return ReadUnaligned(
+ reinterpret_cast<const simd128_value_t*>(&raw_ptr()->value_));
}
void Float32x4::set_value(simd128_value_t value) const {
- StoreSimd128(&raw_ptr()->value_[0], value);
+ StoreUnaligned(reinterpret_cast<simd128_value_t*>(&raw()->ptr()->value_),
+ value);
}
@@ -22487,12 +22489,14 @@ int32_t Int32x4::w() const {
simd128_value_t Int32x4::value() const {
- return simd128_value_t().readFrom(&raw_ptr()->value_[0]);
+ return ReadUnaligned(
+ reinterpret_cast<const simd128_value_t*>(&raw_ptr()->value_));
}
void Int32x4::set_value(simd128_value_t value) const {
- StoreSimd128(&raw_ptr()->value_[0], value);
+ StoreUnaligned(reinterpret_cast<simd128_value_t*>(&raw()->ptr()->value_),
+ value);
}
« no previous file with comments | « runtime/vm/object.h ('k') | tests/lib/typed_data/float32x4_test.dart » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698