[refactoring] Extract read leb to a separate file, share the code between loader and mini loader (#3701)

There's probably a number of other places where the bh_leb_read could be used (e.g. aot loader)
but I'm making the change as small as possible. Further refactoring can be done later.
This commit is contained in:
Marcin Kolny
2024-08-14 01:46:24 +01:00
committed by GitHub
parent a83adccd20
commit 37d7439ef9
9 changed files with 223 additions and 159 deletions

View File

@ -30,6 +30,14 @@ bool
is_indices_overflow(uint32 import, uint32 other, char *error_buf,
uint32 error_buf_size);
bool
read_leb(uint8 **p_buf, const uint8 *buf_end, uint32 maxbits, bool sign,
uint64 *p_result, char *error_buf, uint32 error_buf_size);
void
wasm_loader_set_error_buf(char *error_buf, uint32 error_buf_size,
const char *string, bool is_aot);
#ifdef __cplusplus
}
#endif