Skip to content

Commit

Permalink
pad the instructions array and comment why
Browse files Browse the repository at this point in the history
  • Loading branch information
yamt committed May 7, 2024
1 parent fade19d commit cbcc1c2
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion lib/insn.c
Original file line number Diff line number Diff line change
Expand Up @@ -932,7 +932,12 @@ const static struct instruction_desc instructions_fe[] = {
};
#endif

const struct instruction_desc instructions[] = {
/*
* Note: as 0xfc is occupied unconditionally anyway, allocating up to
* 0xff below doesn't waste much space. on the other hand, it might allow
* a few optimizations in the parser by allowing full uint8_t index.
*/
const struct instruction_desc instructions[256] = {
#include "insn_list_base.h"
#if defined(TOYWASM_ENABLE_WASM_TAILCALL)
#include "insn_list_tailcall.h"
Expand Down

0 comments on commit cbcc1c2

Please sign in to comment.