|
@@ -7071,7 +7071,8 @@ wasm_loader_check_br(WASMLoaderContext *loader_ctx, uint32 depth,
|
|
|
int32 i, available_stack_cell;
|
|
int32 i, available_stack_cell;
|
|
|
uint16 cell_num;
|
|
uint16 cell_num;
|
|
|
|
|
|
|
|
- if (loader_ctx->csp_num < depth + 1) {
|
|
|
|
|
|
|
+ bh_assert(loader_ctx->csp_num > 0);
|
|
|
|
|
+ if (loader_ctx->csp_num - 1 < depth) {
|
|
|
set_error_buf(error_buf, error_buf_size,
|
|
set_error_buf(error_buf, error_buf_size,
|
|
|
"unknown label, "
|
|
"unknown label, "
|
|
|
"unexpected end of section or function");
|
|
"unexpected end of section or function");
|