File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -70,6 +70,7 @@ import {
7070 getUnaryValue ,
7171 getCallOperandAt ,
7272 getCallOperandCount ,
73+ getRefIsNullValue ,
7374 isConstZero ,
7475 isConstNonZero
7576} from "./module" ;
@@ -1049,6 +1050,10 @@ export class Flow {
10491050 }
10501051 break ;
10511052 }
1053+ case ExpressionId . RefIsNull : {
1054+ this . inheritNonnullIfFalse ( getRefIsNullValue ( expr ) , iff ) ; // value == null -> value must have been null
1055+ break ;
1056+ }
10521057 }
10531058 }
10541059
@@ -1140,6 +1145,10 @@ export class Flow {
11401145 }
11411146 break ;
11421147 }
1148+ case ExpressionId . RefIsNull : {
1149+ this . inheritNonnullIfTrue ( getRefIsNullValue ( expr ) , iff ) ; // value == null -> value must have been non-null
1150+ break ;
1151+ }
11431152 }
11441153 }
11451154
Original file line number Diff line number Diff line change @@ -3553,6 +3553,10 @@ export function getMemoryGrowDelta(expr: ExpressionRef): ExpressionRef {
35533553 return binaryen . _BinaryenMemoryGrowGetDelta ( expr ) ;
35543554}
35553555
3556+ export function getRefIsNullValue ( expr : ExpressionRef ) : ExpressionRef {
3557+ return binaryen . _BinaryenRefIsNullGetValue ( expr ) ;
3558+ }
3559+
35563560// functions
35573561
35583562export function getFunctionBody ( func : FunctionRef ) : ExpressionRef {
You can’t perform that action at this time.
0 commit comments