@@ -494,17 +494,42 @@ object (self)
494494 match result#singleton with
495495 | Some ixty -> Some (bcd#get_typ ixty)
496496 | _ ->
497- begin
498- log_evaluation () ;
499- log_diagnostics_result
500- ~tag: (" top type constant in join for " ^ faddr)
501- __FILE__ __LINE__
502- [iaddr ^ " -- " ^ (register_to_string reg) ^ " : "
503- ^ (p2s (pretty_print_list
504- (List. map bcd#get_typ result#toList)
505- (fun ty -> STR (btype_to_string ty)) " [" " ; " " ]" ))];
506- None
507- end
497+ match result#toList with
498+ | [ixty1; ixty2] ->
499+ (match (bcd#get_typ ixty1), (bcd#get_typ ixty2) with
500+ | TPtr (tty1, _), TPtr (tty2, _)
501+ when is_struct_type tty1 && is_scalar tty2 ->
502+ Some (bcd#get_typ ixty1)
503+ | TPtr (tty1, _), TPtr (tty2, _)
504+ when is_struct_type tty2 && is_scalar tty1 ->
505+ Some (bcd#get_typ ixty2)
506+ | _ ->
507+ begin
508+ log_evaluation () ;
509+ log_diagnostics_result
510+ ~tag: (" top type constant in join for " ^ faddr)
511+ __FILE__ __LINE__
512+ [iaddr ^ " -- " ^ (register_to_string reg) ^ " : "
513+ ^ (p2s (pretty_print_list
514+ (List. map bcd#get_typ result#toList)
515+ (fun ty -> STR (btype_to_string ty))
516+ " [" " ; " " ]" ))];
517+ None
518+ end )
519+ | _ ->
520+ begin
521+ log_evaluation () ;
522+ log_diagnostics_result
523+ ~tag: (" top type constant in join for " ^ faddr)
524+ __FILE__ __LINE__
525+ [iaddr ^ " -- " ^ (register_to_string reg) ^ " : "
526+ ^ (p2s (pretty_print_list
527+ (List. map bcd#get_typ result#toList)
528+ (fun ty -> STR (btype_to_string ty))
529+ " [" " ; " " ]" ))];
530+ None
531+ end
532+
508533 end
509534
510535 method resolve_stack_lhs_type
0 commit comments