[wasm] Return empty object when ref2obj fails

This commit is contained in:
Behdad Esfahbod 2023-02-23 13:00:06 -07:00
parent e87b1b3ec3
commit 69b1707d82
3 changed files with 1 additions and 6 deletions

View File

@ -39,8 +39,6 @@ face_reference_table (HB_WASM_EXEC_ENV_COMPOUND
HB_RETURN_TYPE (blob_t, blob);
HB_REF2OBJ (face);
if (unlikely (!face))
return;
blob.length = 1;
}

View File

@ -36,8 +36,6 @@ font_get_face (HB_WASM_EXEC_ENV
font_t fontref)
{
HB_REF2OBJ (font);
if (unlikely (!font))
return nullref;
hb_face_t *face = hb_font_get_face (font);
@ -46,7 +44,6 @@ font_get_face (HB_WASM_EXEC_ENV
}
}}
#endif /* HB_WASM_FONT_HH */

View File

@ -64,7 +64,7 @@ HB_INTERNAL extern hb_user_data_key_t _hb_wasm_ref_type_key;
/* This works because all our objects have the same hb_object_t layout. */ \
if (unlikely (hb_##obj##_get_user_data (obj, &_hb_wasm_ref_type_key) != \
(void *) hb_wasm_ref_type_##obj)) \
obj = nullptr; \
obj = hb_##obj##_get_empty (); \
} HB_STMT_END
#define HB_OBJ2REF(obj) \
uint32_t obj##ref = nullref; \