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 {
70
70
getUnaryValue ,
71
71
getCallOperandAt ,
72
72
getCallOperandCount ,
73
+ getRefIsNullValue ,
73
74
isConstZero ,
74
75
isConstNonZero
75
76
} from "./module" ;
@@ -1049,6 +1050,10 @@ export class Flow {
1049
1050
}
1050
1051
break ;
1051
1052
}
1053
+ case ExpressionId . RefIsNull : {
1054
+ this . inheritNonnullIfFalse ( getRefIsNullValue ( expr ) , iff ) ; // value == null -> value must have been null
1055
+ break ;
1056
+ }
1052
1057
}
1053
1058
}
1054
1059
@@ -1140,6 +1145,10 @@ export class Flow {
1140
1145
}
1141
1146
break ;
1142
1147
}
1148
+ case ExpressionId . RefIsNull : {
1149
+ this . inheritNonnullIfTrue ( getRefIsNullValue ( expr ) , iff ) ; // value == null -> value must have been non-null
1150
+ break ;
1151
+ }
1143
1152
}
1144
1153
}
1145
1154
Original file line number Diff line number Diff line change @@ -3553,6 +3553,10 @@ export function getMemoryGrowDelta(expr: ExpressionRef): ExpressionRef {
3553
3553
return binaryen . _BinaryenMemoryGrowGetDelta ( expr ) ;
3554
3554
}
3555
3555
3556
+ export function getRefIsNullValue ( expr : ExpressionRef ) : ExpressionRef {
3557
+ return binaryen . _BinaryenRefIsNullGetValue ( expr ) ;
3558
+ }
3559
+
3556
3560
// functions
3557
3561
3558
3562
export function getFunctionBody ( func : FunctionRef ) : ExpressionRef {
You can’t perform that action at this time.
0 commit comments