Add error check to VM_OC_CLASS_INHERITANCE (#3122)

ecma_op_object_get_by_magic_id can throw an exception

Fixes #3121

JerryScript-DCO-1.0-Signed-off-by: Daniel Balla dballa@inf.u-szeged.hu
This commit is contained in:
Daniel Balla
2019-09-16 12:32:56 +03:00
committed by Zoltan Herczeg
parent 83c44d20b3
commit 87441635e1
2 changed files with 24 additions and 0 deletions
+7
View File
@@ -1405,6 +1405,13 @@ vm_loop (vm_frame_ctx_t *frame_ctx_p) /**< frame context */
{
ecma_value_t super_prototype_value = ecma_op_object_get_by_magic_id (super_class_p,
LIT_MAGIC_STRING_PROTOTYPE);
if (ECMA_IS_VALUE_ERROR (super_prototype_value))
{
result = super_prototype_value;
goto error;
}
if (ecma_get_object_type (super_class_p) == ECMA_OBJECT_TYPE_BOUND_FUNCTION
&& !ecma_is_value_object (super_prototype_value))
{