Update detached arraybuffer handling (#4840)
- Fix isValidIntegerIndex usage in IntegerIndexed objects, [[Get]], [[Set]], [[DefineOwnProperty]] internal methods. - The test262 revision is updated to the latest master hash. - The PR is not separated into individual PRs since the standard change couldn't be tested without the new test262 revision. JerryScript-DCO-1.0-Signed-off-by: Adam Szilagyi aszilagy@inf.u-szeged.hu
This commit is contained in:
@@ -299,11 +299,18 @@ ecma_op_dataview_get_set_view_value (ecma_value_t view, /**< the operation's 'vi
|
||||
/* GetViewValue 4., SetViewValue 6. */
|
||||
bool is_little_endian = ecma_op_to_boolean (is_little_endian_value);
|
||||
|
||||
if (ECMA_ARRAYBUFFER_CHECK_BUFFER_ERROR (buffer_p))
|
||||
if (ECMA_ARRAYBUFFER_LAZY_ALLOC (buffer_p))
|
||||
{
|
||||
ecma_free_value (value_to_set);
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
|
||||
if (ecma_arraybuffer_is_detached (buffer_p))
|
||||
{
|
||||
ecma_free_value (value_to_set);
|
||||
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
|
||||
}
|
||||
|
||||
/* GetViewValue 7., SetViewValue 9. */
|
||||
uint32_t view_offset = view_p->byte_offset;
|
||||
|
||||
@@ -320,11 +327,18 @@ ecma_op_dataview_get_set_view_value (ecma_value_t view, /**< the operation's 'vi
|
||||
return ecma_raise_range_error (ECMA_ERR_START_OFFSET_IS_OUTSIDE_THE_BOUNDS_OF_THE_BUFFER);
|
||||
}
|
||||
|
||||
if (ECMA_ARRAYBUFFER_CHECK_BUFFER_ERROR (buffer_p))
|
||||
if (ECMA_ARRAYBUFFER_LAZY_ALLOC (buffer_p))
|
||||
{
|
||||
ecma_free_value (value_to_set);
|
||||
return ECMA_VALUE_ERROR;
|
||||
}
|
||||
|
||||
if (ecma_arraybuffer_is_detached (buffer_p))
|
||||
{
|
||||
ecma_free_value (value_to_set);
|
||||
return ecma_raise_type_error (ECMA_ERR_ARRAYBUFFER_IS_DETACHED);
|
||||
}
|
||||
|
||||
/* GetViewValue 11., SetViewValue 13. */
|
||||
bool system_is_little_endian = ecma_dataview_check_little_endian ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user