From 529c8a1281064d4d30489f7ea9996976ad320554 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Wed, 1 Sep 2010 12:02:13 -0600 Subject: [PATCH] fix mutable-field check for proxy-struct --- src/racket/src/struct.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/racket/src/struct.c b/src/racket/src/struct.c index 995fc08e99..bcaccf92c0 100644 --- a/src/racket/src/struct.c +++ b/src/racket/src/struct.c @@ -5176,7 +5176,9 @@ static Scheme_Object *do_chaperone_struct(const char *name, int is_proxy, int ar if (is_proxy) { /* Must not be an immutable field. */ if (stype->immutables) { - if (stype->immutables[pi->field]) + if (stype->immutables[pi->field - (pi->struct_type->name_pos + ? pi->struct_type->parent_types[pi->struct_type->name_pos - 1]->num_slots + : 0)]) scheme_raise_exn(MZEXN_FAIL_CONTRACT, "%s: cannot replace %s for an immutable field: %V", name,