Commit 42229d6
committed
gccrs: fix segfault in clone_pattern w macro
Check if parser throw an error to avoid cloning nullptr
Fixes #4140
gcc/rust/ChangeLog:
* expand/rust-macro-expand.cc (transcribe_expression): Check if
parser didn't fail.
(transcribe_type): Likewise.
(transcribe_pattern): Likewise.
Signed-off-by: lenny.chiadmi-delage <[email protected]>1 parent b92a684 commit 42229d6
1 file changed
+9
-6
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
962 | 962 | | |
963 | 963 | | |
964 | 964 | | |
965 | | - | |
966 | | - | |
967 | | - | |
968 | | - | |
969 | | - | |
970 | | - | |
| 965 | + | |
| 966 | + | |
| 967 | + | |
| 968 | + | |
971 | 969 | | |
972 | 970 | | |
973 | 971 | | |
| |||
997 | 995 | | |
998 | 996 | | |
999 | 997 | | |
| 998 | + | |
| 999 | + | |
1000 | 1000 | | |
1001 | 1001 | | |
1002 | 1002 | | |
| |||
1018 | 1018 | | |
1019 | 1019 | | |
1020 | 1020 | | |
| 1021 | + | |
| 1022 | + | |
| 1023 | + | |
1021 | 1024 | | |
1022 | 1025 | | |
1023 | 1026 | | |
| |||
0 commit comments