From 4c8917c4284a3e269bfd4e3594770e05d2b49f4e Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Sat, 9 Jul 2005 13:19:14 +0000 Subject: [PATCH] fixed assignment in sub-struct with immutable field svn: r369 --- src/mzscheme/src/struct.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/mzscheme/src/struct.c b/src/mzscheme/src/struct.c index 2c570dda8c..e4fc74fe77 100644 --- a/src/mzscheme/src/struct.c +++ b/src/mzscheme/src/struct.c @@ -1089,11 +1089,12 @@ static Scheme_Object *struct_setter(Struct_Proc_Info *i, int argc, Scheme_Object if (i->struct_type->immutables) { Scheme_Struct_Type *t = i->struct_type; + int p = pos; if (t->name_pos) - pos -= t->parent_types[t->name_pos - 1]->num_slots; + p -= t->parent_types[t->name_pos - 1]->num_slots; - if (t->immutables[pos]) { + if (t->immutables[p]) { scheme_arg_mismatch(i->func_name, "cannot modify value of immutable field in structure: ", args[0]);