Commit 61f7ec3
committed
Fix null pointer crash in tokenDelete function
The tokenDelete() function in main/tokeninfo.c was being called with NULL
pointers from the R6 parser error handling code, causing segmentation faults.
The R6 parser in parsers/r-r6class.c had a comment stating "tokenDelete
accepts NULL" but the function did not actually handle NULL pointers safely.
This occurred when parsing malformed R6 syntax such as:
- R6::SomethingElse() (wrong function after R6 namespace)
- R6:: (incomplete namespace reference)
- R6::R6Clas() (typo in R6Class)
The fix ensures ctags handles malformed R6 syntax gracefully by falling back
to parsing assignments as regular global variables instead of crashing.
Fixes segmentation fault when processing certain R6Class syntax patterns.
Signed-off-by: Bernát Gábor <[email protected]>1 parent ead1d93 commit 61f7ec3
File tree
4 files changed
+20
-1
lines changed- Units/parser-r6class.r/r6-null-pointer-regression.d
- main
4 files changed
+20
-1
lines changedLines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 3 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
Lines changed: 12 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
94 | | - | |
| 94 | + | |
| 95 | + | |
95 | 96 | | |
96 | 97 | | |
97 | 98 | | |
| |||
0 commit comments