fix checking of attempt to impersonte non-struct via mutator
This commit is contained in:
parent
dc0653383f
commit
ca3757367d
|
@ -1508,4 +1508,10 @@
|
|||
|
||||
;; ----------------------------------------
|
||||
|
||||
(let ()
|
||||
(struct s ([a #:mutable]))
|
||||
(err/rt-test (impersonate-struct 5 set-s-a! (lambda (a b) b))))
|
||||
|
||||
;; ----------------------------------------
|
||||
|
||||
(report-errs)
|
||||
|
|
|
@ -5458,7 +5458,10 @@ static Scheme_Object *do_chaperone_struct(const char *name, int is_impersonator,
|
|||
if (SCHEME_CHAPERONEP(proc)) proc = SCHEME_CHAPERONE_VAL(proc);
|
||||
if (SCHEME_TRUEP(struct_setter_p(1, a))) {
|
||||
kind = "mutator";
|
||||
offset = stype->num_slots;
|
||||
if (stype)
|
||||
offset = stype->num_slots;
|
||||
else
|
||||
offset = 0;
|
||||
} else if (SCHEME_TRUEP(struct_getter_p(1, a))) {
|
||||
kind = "accessor";
|
||||
offset = 0;
|
||||
|
|
Loading…
Reference in New Issue
Block a user