mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-19 05:39:18 +02:00
sexp_emit_word should align before expanding
This commit is contained in:
parent
607d70c6a0
commit
ad59eee89f
1 changed files with 1 additions and 1 deletions
2
vm.c
2
vm.c
|
@ -114,11 +114,11 @@ static void bytecode_preserve (sexp ctx, sexp obj) {
|
||||||
|
|
||||||
static void sexp_emit_word (sexp ctx, sexp_uint_t val) {
|
static void sexp_emit_word (sexp ctx, sexp_uint_t val) {
|
||||||
unsigned char *data;
|
unsigned char *data;
|
||||||
|
sexp_context_align_pos(ctx);
|
||||||
sexp_expand_bcode(ctx, sizeof(sexp));
|
sexp_expand_bcode(ctx, sizeof(sexp));
|
||||||
if (sexp_exceptionp(sexp_context_exception(ctx)))
|
if (sexp_exceptionp(sexp_context_exception(ctx)))
|
||||||
return;
|
return;
|
||||||
data = sexp_bytecode_data(sexp_context_bc(ctx));
|
data = sexp_bytecode_data(sexp_context_bc(ctx));
|
||||||
sexp_context_align_pos(ctx);
|
|
||||||
*((sexp_uint_t*)(&(data[sexp_unbox_fixnum(sexp_context_pos(ctx))]))) = val;
|
*((sexp_uint_t*)(&(data[sexp_unbox_fixnum(sexp_context_pos(ctx))]))) = val;
|
||||||
sexp_inc_context_pos(ctx, sizeof(sexp));
|
sexp_inc_context_pos(ctx, sizeof(sexp));
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Reference in a new issue