Commit dd954ea
committed
CFG: correct flow for lambda bodies
Lambda bodies are parsed as nested do-blocks or normal blocks.
This is actually incorrect, as the body of a lambda can't have
parameters. However, we can "inline" such blocks to get the
desired control flow.1 parent eafec43 commit dd954ea
3 files changed
Lines changed: 32 additions & 20 deletions
File tree
- ql
- src/codeql_ruby/controlflow
- internal
- test/library-tests/controlflow/graph
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
76 | 76 | | |
77 | 77 | | |
78 | 78 | | |
| 79 | + | |
| 80 | + | |
79 | 81 | | |
80 | 82 | | |
81 | 83 | | |
| |||
88 | 90 | | |
89 | 91 | | |
90 | 92 | | |
| 93 | + | |
| 94 | + | |
91 | 95 | | |
92 | 96 | | |
93 | 97 | | |
| |||
103 | 107 | | |
104 | 108 | | |
105 | 109 | | |
106 | | - | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
| 117 | + | |
107 | 118 | | |
108 | 119 | | |
109 | 120 | | |
110 | | - | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
111 | 126 | | |
112 | 127 | | |
113 | 128 | | |
| |||
Lines changed: 13 additions & 5 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
431 | 431 | | |
432 | 432 | | |
433 | 433 | | |
434 | | - | |
| 434 | + | |
435 | 435 | | |
436 | 436 | | |
437 | 437 | | |
| |||
679 | 679 | | |
680 | 680 | | |
681 | 681 | | |
682 | | - | |
683 | | - | |
684 | | - | |
| 682 | + | |
| 683 | + | |
| 684 | + | |
| 685 | + | |
| 686 | + | |
685 | 687 | | |
686 | | - | |
| 688 | + | |
| 689 | + | |
| 690 | + | |
| 691 | + | |
| 692 | + | |
| 693 | + | |
| 694 | + | |
687 | 695 | | |
688 | 696 | | |
689 | 697 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
49 | 49 | | |
50 | 50 | | |
51 | 51 | | |
52 | | - | |
53 | | - | |
54 | | - | |
55 | 52 | | |
56 | 53 | | |
57 | 54 | | |
| |||
1375 | 1372 | | |
1376 | 1373 | | |
1377 | 1374 | | |
1378 | | - | |
| 1375 | + | |
1379 | 1376 | | |
1380 | 1377 | | |
1381 | 1378 | | |
1382 | 1379 | | |
1383 | 1380 | | |
1384 | 1381 | | |
1385 | 1382 | | |
1386 | | - | |
1387 | | - | |
1388 | | - | |
1389 | 1383 | | |
1390 | | - | |
| 1384 | + | |
1391 | 1385 | | |
1392 | 1386 | | |
1393 | 1387 | | |
| |||
3690 | 3684 | | |
3691 | 3685 | | |
3692 | 3686 | | |
3693 | | - | |
3694 | | - | |
3695 | 3687 | | |
3696 | 3688 | | |
3697 | 3689 | | |
| |||
3821 | 3813 | | |
3822 | 3814 | | |
3823 | 3815 | | |
3824 | | - | |
3825 | | - | |
3826 | | - | |
3827 | 3816 | | |
3828 | 3817 | | |
3829 | 3818 | | |
| |||
0 commit comments