File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1771,10 +1771,21 @@ void TranslateToFuzzReader::mutate(Function* func) {
17711771 void noteNonFlowSubtype (Expression* sub, Type super) {
17721772 noteSubtype (sub, super);
17731773 }
1774- // TODO: casts, use top
1774+
1775+ // Casts always accept the top type.
17751776 void noteCast (HeapType src, HeapType dst) {}
1776- void noteCast (Expression* src, Type dst) {}
1777- void noteCast (Expression* src, Expression* dst) {}
1777+ void noteCast (Expression* src, Type dst) {
1778+ if (!src || !dst.isRef ()) {
1779+ return ;
1780+ }
1781+ childTypes[src] = dst.with (dst.getHeapType ().getTop ()).with (Nullable);
1782+ }
1783+ void noteCast (Expression* src, Expression* dst) {
1784+ if (!dst) {
1785+ return ;
1786+ }
1787+ noteCast (src, dst->type );
1788+ }
17781789 } finder;
17791790 finder.walkFunctionInModule (func, &wasm);
17801791
You can’t perform that action at this time.
0 commit comments