File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -91,14 +91,14 @@ struct LowerUnflattenable : public PostWalker<LowerUnflattenable> {
9191 case BrOnNull: {
9292 condition = builder.makeRefIsNull (refTee);
9393 brValue = nullptr ;
94- flowValue = getRef ();
94+ flowValue = builder. makeRefAs (RefAsNonNull, getRef () );
9595 break ;
9696 }
9797 case BrOnNonNull: {
9898 condition = builder.makeRefIsNull (refTee);
9999 flip = true ;
100100 brValue = builder.makeRefAs (RefAsNonNull, getRef ());
101- flowValue = builder. makeRefAs (RefAsNonNull, getRef () );
101+ flowValue = getRef ();
102102 break ;
103103 }
104104 case BrOnCast: {
Original file line number Diff line number Diff line change 99 ;; CHECK: (type $B (sub $A (struct)))
1010 (type $B (sub $A (struct )))
1111
12+ (func $br_on_null (param $x (ref null $A )) (result (ref $A ))
13+ (block $non-null (result (ref $A ))
14+ (block $block
15+ (return
16+ (br_on_null $block
17+ (local.get $x )
18+ )
19+ )
20+ )
21+ (unreachable )
22+ )
23+ )
24+
1225 ;; CHECK: (func $br_on_non_null (type $2) (param $x (ref null $A)) (result (ref $A))
1326 ;; CHECK-NEXT: (local $1 (ref null $A))
1427 ;; CHECK-NEXT: (local $2 (ref null $A))
You can’t perform that action at this time.
0 commit comments