fix bad case-lambda sharing that breaks let-depth tracking

This commit is contained in:
Matthew Flatt 2015-01-06 12:43:29 -07:00
parent 3408209f66
commit e82487429b

View File

@ -1329,12 +1329,13 @@ static Scheme_Native_Closure_Data *create_native_case_lambda(Scheme_Case_Lambda
o = c->array[i];
if (SCHEME_PROCP(o))
o = (Scheme_Object *)((Scheme_Closure *)o)->code;
data = (Scheme_Closure_Data *)o;
data = MALLOC_ONE_TAGGED(Scheme_Closure_Data);
memcpy(data, o, sizeof(Scheme_Closure_Data));
ensure_closure_native(data, ndata);
if (data->u.native_code->max_let_depth > max_let_depth)
max_let_depth = data->u.native_code->max_let_depth;
c->array[i] = (Scheme_Object *)data;
}
printf("%d\n", max_let_depth);
ndata->max_let_depth = max_let_depth;
ndata->closure_size = -(count + 1); /* Indicates case-lambda */