+ // Size of the fragment:
+ size = state->heapinfo1[block1].busy_frag.frag_size[frag1];
+
+ // Remember (basic) type inference.
+ // The current data structure only allows us to do this for the whole block.
+ if(type != NULL && area1==real_addr_frag1){
+ state->types1[block1][frag1] = type;
+ }
+ if(type != NULL && area2==real_addr_frag2) {
+ state->types2[block2][frag2] = type;
+ }
+
+ // The type of the variable is already known:
+ if(type) {
+ new_type1 = type;
+ new_type2 = type;
+ }
+
+ // Type inference from the block type.
+ else if(state->types1[block1][frag1] != NULL || state->types2[block2][frag2] != NULL) {
+
+ offset1 = (char *)area1 - (char *)real_addr_frag1;
+ offset2 = (char *)area2 - (char *)real_addr_frag2;
+
+ if(state->types1[block1][frag1] != NULL && state->types2[block2][frag2] != NULL){
+ new_type1 = get_offset_type(real_addr_frag1, state->types1[block1][frag1], offset1, size, snapshot1);
+ new_type2 = get_offset_type(real_addr_frag2, state->types2[block2][frag2], offset1, size, snapshot2);
+ }else if(state->types1[block1][frag1] != NULL){
+ new_type1 = get_offset_type(real_addr_frag1, state->types1[block1][frag1], offset1, size, snapshot1);
+ new_type2 = get_offset_type(real_addr_frag2, state->types1[block1][frag1], offset2, size, snapshot2);
+ }else if(state->types2[block2][frag2] != NULL){
+ new_type1 = get_offset_type(real_addr_frag1, state->types2[block2][frag2], offset1, size, snapshot1);
+ new_type2 = get_offset_type(real_addr_frag2, state->types2[block2][frag2], offset2, size, snapshot2);
+ }else{
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return -1;
+ }
+
+ if(new_type1 != NULL && new_type2 != NULL && new_type1!=new_type2){
+
+ type = new_type1;
+ while(type->byte_size == 0 && type->subtype != NULL)
+ type = type->subtype;
+ new_size1 = type->byte_size;
+
+ type = new_type2;
+ while(type->byte_size == 0 && type->subtype != NULL)
+ type = type->subtype;
+ new_size2 = type->byte_size;
+
+ }else{
+ if(match_pairs){
+ match_equals(state, previous);
+ xbt_dynar_free(&previous);
+ }
+ return -1;