From 88bd4f77dfcd7c8155fe3bfe90846cfa661cdedd Mon Sep 17 00:00:00 2001 From: zhenweijin Date: Wed, 13 Aug 2025 11:16:01 +0800 Subject: [PATCH] remove duplicate parent type index validation Signed-off-by: zhenweijin --- core/iwasm/aot/aot_loader.c | 14 -------------- 1 file changed, 14 deletions(-) diff --git a/core/iwasm/aot/aot_loader.c b/core/iwasm/aot/aot_loader.c index b36d5aa3ad..67a85694c5 100644 --- a/core/iwasm/aot/aot_loader.c +++ b/core/iwasm/aot/aot_loader.c @@ -2073,13 +2073,6 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module, AOTType *cur_type = module->types[j]; parent_type_idx = cur_type->parent_type_idx; if (parent_type_idx != (uint32)-1) { /* has parent */ -#if WASM_ENABLE_AOT_VALIDATOR != 0 - if (parent_type_idx >= module->type_count) { - set_error_buf(error_buf, error_buf_size, - "invalid parent type index"); - goto fail; - } -#endif AOTType *parent_type = module->types[parent_type_idx]; module->types[j]->parent_type = parent_type; @@ -2103,13 +2096,6 @@ load_types(const uint8 **p_buf, const uint8 *buf_end, AOTModule *module, AOTType *cur_type = module->types[j]; parent_type_idx = cur_type->parent_type_idx; if (parent_type_idx != (uint32)-1) { /* has parent */ -#if WASM_ENABLE_AOT_VALIDATOR != 0 - if (parent_type_idx >= module->type_count) { - set_error_buf(error_buf, error_buf_size, - "invalid parent type index"); - goto fail; - } -#endif AOTType *parent_type = module->types[parent_type_idx]; /* subtyping has been checked during compilation */ bh_assert(wasm_type_is_subtype_of(