File tree Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Expand file tree Collapse file tree 2 files changed +24
-1
lines changed Original file line number Diff line number Diff line change @@ -849,7 +849,11 @@ struct Unsubtyping : Pass {
849
849
// Add all the edges. Don't worry about duplicating existing edges because
850
850
// checking whether they're necessary now would be about as expensive as
851
851
// discarding them later.
852
- noteSubtype (*sub, *super);
852
+ // TODO: We will be able to assume this once we update the descriptor
853
+ // validation rules.
854
+ if (HeapType::isSubType (*sub, *super)) {
855
+ noteSubtype (*sub, *super);
856
+ }
853
857
noteSubtype (*subDesc, *superDesc);
854
858
noteDescriptor (*super, *superDesc);
855
859
noteDescriptor (*sub, *subDesc);
Original file line number Diff line number Diff line change 1086
1086
)
1087
1087
)
1088
1088
)
1089
+
1090
+ ;; This will be invalid soon, but in the meantime we should not be confused when
1091
+ ;; the types described by two related descriptors are unrelated.
1092
+ (module
1093
+ (rec
1094
+ ;; CHECK: (rec
1095
+ ;; CHECK-NEXT: (type $A (descriptor $super (struct)))
1096
+ (type $A (descriptor $super (struct )))
1097
+ ;; CHECK: (type $B (descriptor $sub (struct)))
1098
+ (type $B (descriptor $sub (struct )))
1099
+ ;; CHECK: (type $super (sub (describes $A (struct))))
1100
+ (type $super (sub (describes $A (struct ))))
1101
+ ;; CHECK: (type $sub (sub $super (describes $B (struct))))
1102
+ (type $sub (sub $super (describes $B (struct ))))
1103
+ )
1104
+ ;; CHECK: (global $public (ref null $B) (ref.null none))
1105
+ (global $public (export " public" ) (ref null $B ) (ref.null none))
1106
+ )
1107
+ ;; CHECK: (export "public" (global $public))
You can’t perform that action at this time.
0 commit comments