@@ -99,9 +99,9 @@ int64_t LLV8::LoadUnsigned(int64_t addr, uint32_t byte_size, Error& err) {
9999
100100double LLV8::LoadDouble (int64_t addr, Error& err) {
101101 SBError sberr;
102- int64_t value = process_. ReadUnsignedFromMemory ( static_cast < addr_t >(addr),
103- sizeof (double ), sberr);
104- if (sberr.Fail ()) {
102+ double value;
103+ size_t result = process_. ReadMemory ( static_cast < addr_t >(addr), &value, sizeof (double ), sberr);
104+ if (sberr.Fail () || result != sizeof ( double ) ) {
105105 err = Error::Failure (
106106 " Failed to load double from v8 memory, "
107107 " addr=0x%016" PRIx64,
@@ -110,7 +110,7 @@ double LLV8::LoadDouble(int64_t addr, Error& err) {
110110 }
111111
112112 err = Error::Ok ();
113- return * reinterpret_cast < double *>(& value) ;
113+ return value;
114114}
115115
116116
@@ -1108,9 +1108,7 @@ Value JSObject::GetDescriptorProperty(std::string key_name, Map map,
11081108
11091109 if (descriptors.IsConstFieldDetails (details) ||
11101110 descriptors.IsDescriptorDetails (details)) {
1111- Value value;
1112-
1113- value = descriptors.GetValue (i, err);
1111+ descriptors.GetValue (i, err);
11141112 if (err.Fail ()) return Value ();
11151113
11161114 continue ;
@@ -1127,11 +1125,10 @@ Value JSObject::GetDescriptorProperty(std::string key_name, Map map,
11271125 int64_t index = descriptors.FieldIndex (details) - in_object_count;
11281126
11291127 if (descriptors.IsDoubleField (details)) {
1130- double value;
11311128 if (index < 0 ) {
1132- value = GetInObjectValue<double >(instance_size, index, err);
1129+ GetInObjectValue<double >(instance_size, index, err);
11331130 } else {
1134- value = extra_properties.Get <double >(index, err);
1131+ extra_properties.Get <double >(index, err);
11351132 }
11361133
11371134 if (err.Fail ()) return Value ();
0 commit comments