@@ -446,14 +446,19 @@ ctxt<T>::walk_res(bool align) {
446
446
447
447
uint16_t n_ty_params = get_u16_bump (sp);
448
448
449
- uint16_t ty_params_size = get_u16_bump (sp);
450
- const uint8_t *ty_params_sp = sp;
451
- sp += ty_params_size;
449
+ // Read in the tag type parameters.
450
+ type_param params[n_ty_params];
451
+ for (uint16_t i = 0 ; i < n_ty_params; i++) {
452
+ uint16_t ty_param_len = get_u16_bump (sp);
453
+ const uint8_t *next_sp = sp + ty_param_len;
454
+ params[i].set (this );
455
+ sp = next_sp;
456
+ }
452
457
453
458
uint16_t sp_size = get_u16_bump (sp);
454
459
const uint8_t *end_sp = sp + sp_size;
455
460
456
- static_cast <T *>(this )->walk_res (align, dtor, n_ty_params, ty_params_sp ,
461
+ static_cast <T *>(this )->walk_res (align, dtor, n_ty_params, params ,
457
462
end_sp);
458
463
459
464
sp = end_sp;
@@ -479,8 +484,8 @@ class print : public ctxt<print> {
479
484
480
485
void walk_tag (bool align, tag_info &tinfo);
481
486
void walk_struct (bool align, const uint8_t *end_sp);
482
- void walk_res (bool align, const rust_fn *dtor, uint16_t n_ty_params ,
483
- const uint8_t *ty_params_sp , const uint8_t *end_sp);
487
+ void walk_res (bool align, const rust_fn *dtor, unsigned n_params ,
488
+ const type_param *params , const uint8_t *end_sp);
484
489
void walk_var (bool align, uint8_t param);
485
490
486
491
void walk_evec (bool align, bool is_pod, uint16_t sp_size) {
@@ -559,8 +564,8 @@ class size_of : public ctxt<size_of> {
559
564
sa = sub.sa ;
560
565
}
561
566
562
- void walk_res (bool align, const rust_fn *dtor, uint16_t n_ty_params ,
563
- const uint8_t *ty_params_sp , const uint8_t *end_sp) {
567
+ void walk_res (bool align, const rust_fn *dtor, unsigned n_params ,
568
+ const type_param *params , const uint8_t *end_sp) {
564
569
abort (); // TODO
565
570
}
566
571
@@ -788,12 +793,12 @@ class data : public ctxt< data<T,U> > {
788
793
dp = next_dp;
789
794
}
790
795
791
- void walk_res (bool align, const rust_fn *dtor, uint16_t n_ty_params ,
792
- const uint8_t *ty_params_sp , const uint8_t *end_sp) {
796
+ void walk_res (bool align, const rust_fn *dtor, unsigned n_params ,
797
+ const type_param *params , const uint8_t *end_sp) {
793
798
typename U::template data<uintptr_t >::t live = bump_dp<uintptr_t >(dp);
794
799
// Delegate to the implementation.
795
- static_cast <T *>(this )->walk_res (align, dtor, n_ty_params ,
796
- ty_params_sp, end_sp, live);
800
+ static_cast <T *>(this )->walk_res (align, dtor, n_params, params ,
801
+ end_sp, live);
797
802
}
798
803
799
804
void walk_var (bool align, uint8_t param_index) {
@@ -1006,9 +1011,8 @@ class log : public data<log,ptr> {
1006
1011
const std::pair<const uint8_t *,const uint8_t *>
1007
1012
variant_ptr_and_end);
1008
1013
void walk_string (const std::pair<ptr,ptr> &data);
1009
- void walk_res (bool align, const rust_fn *dtor, uint16_t n_ty_params,
1010
- const uint8_t *ty_params_sp, const uint8_t *end_sp,
1011
- bool live);
1014
+ void walk_res (bool align, const rust_fn *dtor, unsigned n_params,
1015
+ const type_param *params, const uint8_t *end_sp, bool live);
1012
1016
1013
1017
template <typename T>
1014
1018
void walk_number () { out << get_dp<T>(dp); }
0 commit comments