|
| 1 | +diff --git a/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_loader.c b/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_loader.c |
| 2 | +index a3c4f42..eb7bf58 100644 |
| 3 | +--- a/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_loader.c |
| 4 | ++++ b/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_loader.c |
| 5 | +@@ -5475,6 +5475,7 @@ wasm_loader_pop_frame_ref(WASMLoaderContext *ctx, uint8 type, char *error_buf, |
| 6 | + return true; |
| 7 | + } |
| 8 | + |
| 9 | ++#if WASM_ENABLE_FAST_INTERP == 0 |
| 10 | + static bool |
| 11 | + wasm_loader_push_pop_frame_ref(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 12 | + uint8 type_push, uint8 type_pop, char *error_buf, |
| 13 | +@@ -5489,6 +5490,7 @@ wasm_loader_push_pop_frame_ref(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 14 | + return false; |
| 15 | + return true; |
| 16 | + } |
| 17 | ++#endif |
| 18 | + |
| 19 | + static bool |
| 20 | + wasm_loader_push_frame_csp(WASMLoaderContext *ctx, uint8 label_type, |
| 21 | +@@ -6165,27 +6167,6 @@ wasm_loader_pop_frame_offset(WASMLoaderContext *ctx, uint8 type, |
| 22 | + return true; |
| 23 | + } |
| 24 | + |
| 25 | +-static bool |
| 26 | +-wasm_loader_push_pop_frame_offset(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 27 | +- uint8 type_push, uint8 type_pop, |
| 28 | +- bool disable_emit, int16 operand_offset, |
| 29 | +- char *error_buf, uint32 error_buf_size) |
| 30 | +-{ |
| 31 | +- uint8 i; |
| 32 | +- |
| 33 | +- for (i = 0; i < pop_cnt; i++) { |
| 34 | +- if (!wasm_loader_pop_frame_offset(ctx, type_pop, error_buf, |
| 35 | +- error_buf_size)) |
| 36 | +- return false; |
| 37 | +- } |
| 38 | +- if (!wasm_loader_push_frame_offset(ctx, type_push, disable_emit, |
| 39 | +- operand_offset, error_buf, |
| 40 | +- error_buf_size)) |
| 41 | +- return false; |
| 42 | +- |
| 43 | +- return true; |
| 44 | +-} |
| 45 | +- |
| 46 | + static bool |
| 47 | + wasm_loader_push_frame_ref_offset(WASMLoaderContext *ctx, uint8 type, |
| 48 | + bool disable_emit, int16 operand_offset, |
| 49 | +@@ -6219,12 +6200,24 @@ wasm_loader_push_pop_frame_ref_offset(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 50 | + bool disable_emit, int16 operand_offset, |
| 51 | + char *error_buf, uint32 error_buf_size) |
| 52 | + { |
| 53 | +- if (!wasm_loader_push_pop_frame_offset(ctx, pop_cnt, type_push, type_pop, |
| 54 | +- disable_emit, operand_offset, |
| 55 | +- error_buf, error_buf_size)) |
| 56 | ++ uint8 i; |
| 57 | ++ |
| 58 | ++ for (i = 0; i < pop_cnt; i++) { |
| 59 | ++ if (!wasm_loader_pop_frame_offset(ctx, type_pop, error_buf, |
| 60 | ++ error_buf_size)) |
| 61 | ++ return false; |
| 62 | ++ |
| 63 | ++ if (!wasm_loader_pop_frame_ref(ctx, type_pop, error_buf, |
| 64 | ++ error_buf_size)) |
| 65 | ++ return false; |
| 66 | ++ } |
| 67 | ++ |
| 68 | ++ if (!wasm_loader_push_frame_offset(ctx, type_push, disable_emit, |
| 69 | ++ operand_offset, error_buf, |
| 70 | ++ error_buf_size)) |
| 71 | + return false; |
| 72 | +- if (!wasm_loader_push_pop_frame_ref(ctx, pop_cnt, type_push, type_pop, |
| 73 | +- error_buf, error_buf_size)) |
| 74 | ++ |
| 75 | ++ if (!wasm_loader_push_frame_ref(ctx, type_push, error_buf, error_buf_size)) |
| 76 | + return false; |
| 77 | + |
| 78 | + return true; |
| 79 | +diff --git a/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_mini_loader.c b/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_mini_loader.c |
| 80 | +index aa5e18f..83be375 100644 |
| 81 | +--- a/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_mini_loader.c |
| 82 | ++++ b/lib/wasm-micro-runtime-WAMR-1.2.2/core/iwasm/interpreter/wasm_mini_loader.c |
| 83 | +@@ -3936,6 +3936,7 @@ wasm_loader_pop_frame_ref(WASMLoaderContext *ctx, uint8 type, char *error_buf, |
| 84 | + return true; |
| 85 | + } |
| 86 | + |
| 87 | ++#if WASM_ENABLE_FAST_INTERP == 0 |
| 88 | + static bool |
| 89 | + wasm_loader_push_pop_frame_ref(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 90 | + uint8 type_push, uint8 type_pop, char *error_buf, |
| 91 | +@@ -3950,6 +3951,7 @@ wasm_loader_push_pop_frame_ref(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 92 | + return false; |
| 93 | + return true; |
| 94 | + } |
| 95 | ++#endif |
| 96 | + |
| 97 | + static bool |
| 98 | + wasm_loader_push_frame_csp(WASMLoaderContext *ctx, uint8 label_type, |
| 99 | +@@ -4607,25 +4609,6 @@ wasm_loader_pop_frame_offset(WASMLoaderContext *ctx, uint8 type, |
| 100 | + return true; |
| 101 | + } |
| 102 | + |
| 103 | +-static bool |
| 104 | +-wasm_loader_push_pop_frame_offset(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 105 | +- uint8 type_push, uint8 type_pop, |
| 106 | +- bool disable_emit, int16 operand_offset, |
| 107 | +- char *error_buf, uint32 error_buf_size) |
| 108 | +-{ |
| 109 | +- for (int i = 0; i < pop_cnt; i++) { |
| 110 | +- if (!wasm_loader_pop_frame_offset(ctx, type_pop, error_buf, |
| 111 | +- error_buf_size)) |
| 112 | +- return false; |
| 113 | +- } |
| 114 | +- if (!wasm_loader_push_frame_offset(ctx, type_push, disable_emit, |
| 115 | +- operand_offset, error_buf, |
| 116 | +- error_buf_size)) |
| 117 | +- return false; |
| 118 | +- |
| 119 | +- return true; |
| 120 | +-} |
| 121 | +- |
| 122 | + static bool |
| 123 | + wasm_loader_push_frame_ref_offset(WASMLoaderContext *ctx, uint8 type, |
| 124 | + bool disable_emit, int16 operand_offset, |
| 125 | +@@ -4659,12 +4642,24 @@ wasm_loader_push_pop_frame_ref_offset(WASMLoaderContext *ctx, uint8 pop_cnt, |
| 126 | + bool disable_emit, int16 operand_offset, |
| 127 | + char *error_buf, uint32 error_buf_size) |
| 128 | + { |
| 129 | +- if (!wasm_loader_push_pop_frame_offset(ctx, pop_cnt, type_push, type_pop, |
| 130 | +- disable_emit, operand_offset, |
| 131 | +- error_buf, error_buf_size)) |
| 132 | ++ uint8 i; |
| 133 | ++ |
| 134 | ++ for (i = 0; i < pop_cnt; i++) { |
| 135 | ++ if (!wasm_loader_pop_frame_offset(ctx, type_pop, error_buf, |
| 136 | ++ error_buf_size)) |
| 137 | ++ return false; |
| 138 | ++ |
| 139 | ++ if (!wasm_loader_pop_frame_ref(ctx, type_pop, error_buf, |
| 140 | ++ error_buf_size)) |
| 141 | ++ return false; |
| 142 | ++ } |
| 143 | ++ |
| 144 | ++ if (!wasm_loader_push_frame_offset(ctx, type_push, disable_emit, |
| 145 | ++ operand_offset, error_buf, |
| 146 | ++ error_buf_size)) |
| 147 | + return false; |
| 148 | +- if (!wasm_loader_push_pop_frame_ref(ctx, pop_cnt, type_push, type_pop, |
| 149 | +- error_buf, error_buf_size)) |
| 150 | ++ |
| 151 | ++ if (!wasm_loader_push_frame_ref(ctx, type_push, error_buf, error_buf_size)) |
| 152 | + return false; |
| 153 | + |
| 154 | + return true; |
0 commit comments