mirror of
https://github.com/ashinn/chibi-scheme.git
synced 2025-05-20 14:19:18 +02:00
sexp_make_setter also needs to register the opcode as returning void
This commit is contained in:
parent
5f4ff27c3d
commit
db4b6fa863
1 changed files with 7 additions and 4 deletions
7
eval.c
7
eval.c
|
@ -1454,15 +1454,18 @@ sexp sexp_make_getter_op (sexp ctx sexp_api_params(self, n), sexp name, sexp typ
|
|||
}
|
||||
|
||||
sexp sexp_make_setter_op (sexp ctx sexp_api_params(self, n), sexp name, sexp type, sexp index) {
|
||||
sexp res;
|
||||
if (sexp_typep(type)) type = sexp_make_fixnum(sexp_type_tag(type));
|
||||
if ((! sexp_fixnump(type)) || (sexp_unbox_fixnum(type) < 0))
|
||||
return sexp_type_exception(ctx, self, SEXP_FIXNUM, type);
|
||||
if ((! sexp_fixnump(index)) || (sexp_unbox_fixnum(index) < 0))
|
||||
return sexp_type_exception(ctx, self, SEXP_FIXNUM, index);
|
||||
return
|
||||
sexp_make_opcode(ctx, self, name, sexp_make_fixnum(SEXP_OPC_SETTER),
|
||||
res
|
||||
= sexp_make_opcode(ctx, self, name, sexp_make_fixnum(SEXP_OPC_SETTER),
|
||||
sexp_make_fixnum(SEXP_OP_SLOT_SET), SEXP_TWO, SEXP_ZERO,
|
||||
type, SEXP_ZERO, SEXP_ZERO, type, index, NULL);
|
||||
if (!sexp_exceptionp(res)) sexp_opcode_return_type(res) = SEXP_VOID;
|
||||
return res;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
|
Loading…
Add table
Reference in a new issue