diff options
| author | Patrick Walton <pcwalton@mimiga.net> | 2011-09-23 16:51:50 -0700 |
|---|---|---|
| committer | Patrick Walton <pcwalton@mimiga.net> | 2011-09-23 17:57:25 -0700 |
| commit | 0c4e0fdfae2fad4a132bdfef3cb856ec5dde84c9 (patch) | |
| tree | 247c7e3e776df8ff964ebca50fb9321696542384 /src/rt/rust_shape.cpp | |
| parent | 6164de90e2277aac21f85894acf79ed0561cd3ae (diff) | |
| download | rust-0c4e0fdfae2fad4a132bdfef3cb856ec5dde84c9.tar.gz rust-0c4e0fdfae2fad4a132bdfef3cb856ec5dde84c9.zip | |
rt: Get rid of the hack that looks for captured type descriptors adjacent to the root one for functions and objects
Diffstat (limited to 'src/rt/rust_shape.cpp')
| -rw-r--r-- | src/rt/rust_shape.cpp | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/src/rt/rust_shape.cpp b/src/rt/rust_shape.cpp index d25c340264e..994c4df0fb9 100644 --- a/src/rt/rust_shape.cpp +++ b/src/rt/rust_shape.cpp @@ -37,7 +37,10 @@ type_param::make(const type_desc **tydescs, unsigned n_tydescs, const type_desc *subtydesc = tydescs[i]; ptrs[i].shape = subtydesc->shape; ptrs[i].tables = subtydesc->shape_tables; - ptrs[i].params = from_tydesc(&subtydesc, arena); + + // FIXME: Doesn't handle a type-parametric object closing over a + // type-parametric object type properly. + ptrs[i].params = from_tydesc(subtydesc, arena); } return ptrs; } @@ -531,8 +534,12 @@ upcall_cmp_type(int8_t *result, rust_task *task, const type_desc *tydesc, const type_desc **subtydescs, uint8_t *data_0, uint8_t *data_1, uint8_t cmp_type) { shape::arena arena; + + // FIXME: This may well be broken when comparing two closures or objects + // that close over different sets of type parameters. shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); + shape::type_param::from_tydesc_and_data(tydesc, data_0, arena); + shape::cmp cmp(task, true, tydesc->shape, params, tydesc->shape_tables, data_0, data_1); cmp.walk(); @@ -552,7 +559,7 @@ upcall_log_type(rust_task *task, const type_desc *tydesc, uint8_t *data, shape::arena arena; shape::type_param *params = - shape::type_param::from_tydesc(&tydesc, arena); + shape::type_param::from_tydesc_and_data(tydesc, data, arena); std::stringstream ss; shape::log log(task, true, tydesc->shape, params, tydesc->shape_tables, |
