tvm
tvm copied to clipboard
[Bugfix][TVMScript] Handle R.match_cast as last binding in if/else
trafficstars
Prior to this commit, using R.match_cast as the last binding would produce a segfault, as var_binding->value was used instead of match_cast->value. In addition, because the last binding of each branch was removed, any changes to the struct info resulting from the match cast were silently discarded.
This commit updates the TVMScript parsing of if/else statements to remove the segfault and maintain the struct info changes produced by the R.match_cast.