Skip to content

Commit

Permalink
define expr->end only for TOYWASM_ENABLE_WRITER
Browse files Browse the repository at this point in the history
just to make it clear what uses it.
  • Loading branch information
yamt committed Feb 2, 2023
1 parent ef750fd commit 88c98a6
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/expr.c
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,9 @@ read_expr_common(const uint8_t **pp, const uint8_t *ep, struct expr *expr,
}
#endif
*pp = p;
#if defined(TOYWASM_ENABLE_WRITER)
expr->end = p;
#endif
xlog_trace("code size %zu, jump table size %zu, max labels %" PRIu32
", cells %" PRIu32,
expr->end - expr->start, ei->njumps * sizeof(*ei->jumps),
Expand Down
2 changes: 2 additions & 0 deletions lib/type.h
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,9 @@ struct expr_exec_info {

struct expr {
const uint8_t *start;
#if defined(TOYWASM_ENABLE_WRITER)
const uint8_t *end;
#endif

struct expr_exec_info ei;
};
Expand Down

0 comments on commit 88c98a6

Please sign in to comment.