Commit 989d877
[JIT] Do not allow creating generics with None types (#44958)
Summary:
Otherwise, invoking something like `python -c "import torch._C;print(torch._C.ListType(None))"` will result in SIGSEGV
Discovered while trying to create a torch script for function with the following type annotation `Tuple[int, Ellipsis] -> None`
Pull Request resolved: #44958
Reviewed By: suo
Differential Revision: D23799906
Pulled By: malfet
fbshipit-source-id: 916a243007d13ed3e7a5b282dd712da3d66e3bf71 parent 0a9ac98 commit 989d877
3 files changed
Lines changed: 14 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
263 | 263 | | |
264 | 264 | | |
265 | 265 | | |
266 | | - | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
267 | 272 | | |
268 | 273 | | |
269 | 274 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
716 | 716 | | |
717 | 717 | | |
718 | 718 | | |
| 719 | + | |
| 720 | + | |
| 721 | + | |
719 | 722 | | |
720 | 723 | | |
721 | 724 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1155 | 1155 | | |
1156 | 1156 | | |
1157 | 1157 | | |
| 1158 | + | |
| 1159 | + | |
| 1160 | + | |
| 1161 | + | |
| 1162 | + | |
1158 | 1163 | | |
1159 | 1164 | | |
1160 | 1165 | | |
| |||
0 commit comments