Commit f1add38
committed
Synthesise writes to
This requires changing the CFG trees for classes and modules from
post-order to pre-order so that we can place the writes at the root node
of the tree, to prevent them overlapping with reads in the body of the
class/module.
We need to do this because classes and modules don't define their own
basic block, but re-use the surrounding one. This problem doesn't occur
for `self` variables in methods because each method has its own basic
block and we can place the write on the entry node of the bock.self for classes/modules1 parent 356828c commit f1add38
File tree
4 files changed
+44
-28
lines changed- ruby/ql
- lib/codeql/ruby
- ast
- controlflow/internal
- dataflow/internal
- test/library-tests/controlflow/graph
4 files changed
+44
-28
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
14 | 14 | | |
15 | 15 | | |
16 | 16 | | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
17 | 20 | | |
18 | 21 | | |
19 | 22 | | |
| |||
Lines changed: 17 additions & 8 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
808 | 808 | | |
809 | 809 | | |
810 | 810 | | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
811 | 816 | | |
812 | | - | |
813 | | - | |
814 | | - | |
815 | | - | |
816 | | - | |
817 | | - | |
| 817 | + | |
818 | 818 | | |
819 | 819 | | |
820 | 820 | | |
821 | 821 | | |
822 | | - | |
823 | | - | |
| 822 | + | |
| 823 | + | |
| 824 | + | |
| 825 | + | |
| 826 | + | |
| 827 | + | |
| 828 | + | |
| 829 | + | |
| 830 | + | |
| 831 | + | |
| 832 | + | |
824 | 833 | | |
825 | 834 | | |
826 | 835 | | |
| |||
Lines changed: 5 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
23 | 23 | | |
24 | 24 | | |
25 | 25 | | |
26 | | - | |
| 26 | + | |
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
30 | 34 | | |
31 | 35 | | |
32 | 36 | | |
| |||
Lines changed: 19 additions & 19 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1056 | 1056 | | |
1057 | 1057 | | |
1058 | 1058 | | |
1059 | | - | |
| 1059 | + | |
1060 | 1060 | | |
1061 | 1061 | | |
1062 | 1062 | | |
| |||
1065 | 1065 | | |
1066 | 1066 | | |
1067 | 1067 | | |
1068 | | - | |
| 1068 | + | |
1069 | 1069 | | |
1070 | 1070 | | |
1071 | 1071 | | |
| |||
1293 | 1293 | | |
1294 | 1294 | | |
1295 | 1295 | | |
1296 | | - | |
| 1296 | + | |
1297 | 1297 | | |
1298 | 1298 | | |
1299 | 1299 | | |
| |||
1620 | 1620 | | |
1621 | 1621 | | |
1622 | 1622 | | |
1623 | | - | |
| 1623 | + | |
1624 | 1624 | | |
1625 | 1625 | | |
1626 | 1626 | | |
| |||
1642 | 1642 | | |
1643 | 1643 | | |
1644 | 1644 | | |
1645 | | - | |
| 1645 | + | |
1646 | 1646 | | |
1647 | 1647 | | |
1648 | 1648 | | |
| |||
1654 | 1654 | | |
1655 | 1655 | | |
1656 | 1656 | | |
1657 | | - | |
| 1657 | + | |
1658 | 1658 | | |
1659 | 1659 | | |
1660 | 1660 | | |
| |||
1663 | 1663 | | |
1664 | 1664 | | |
1665 | 1665 | | |
1666 | | - | |
| 1666 | + | |
1667 | 1667 | | |
1668 | 1668 | | |
1669 | 1669 | | |
| |||
1701 | 1701 | | |
1702 | 1702 | | |
1703 | 1703 | | |
1704 | | - | |
| 1704 | + | |
1705 | 1705 | | |
1706 | 1706 | | |
1707 | 1707 | | |
| |||
1812 | 1812 | | |
1813 | 1813 | | |
1814 | 1814 | | |
1815 | | - | |
| 1815 | + | |
1816 | 1816 | | |
1817 | 1817 | | |
1818 | 1818 | | |
| |||
2832 | 2832 | | |
2833 | 2833 | | |
2834 | 2834 | | |
2835 | | - | |
| 2835 | + | |
2836 | 2836 | | |
2837 | 2837 | | |
2838 | 2838 | | |
| |||
2939 | 2939 | | |
2940 | 2940 | | |
2941 | 2941 | | |
2942 | | - | |
| 2942 | + | |
2943 | 2943 | | |
2944 | 2944 | | |
2945 | 2945 | | |
| |||
2978 | 2978 | | |
2979 | 2979 | | |
2980 | 2980 | | |
2981 | | - | |
| 2981 | + | |
2982 | 2982 | | |
2983 | 2983 | | |
2984 | 2984 | | |
| |||
3907 | 3907 | | |
3908 | 3908 | | |
3909 | 3909 | | |
3910 | | - | |
| 3910 | + | |
3911 | 3911 | | |
3912 | 3912 | | |
3913 | 3913 | | |
| |||
3918 | 3918 | | |
3919 | 3919 | | |
3920 | 3920 | | |
3921 | | - | |
| 3921 | + | |
3922 | 3922 | | |
3923 | 3923 | | |
3924 | | - | |
| 3924 | + | |
3925 | 3925 | | |
3926 | 3926 | | |
3927 | | - | |
| 3927 | + | |
3928 | 3928 | | |
3929 | 3929 | | |
3930 | 3930 | | |
| |||
5070 | 5070 | | |
5071 | 5071 | | |
5072 | 5072 | | |
5073 | | - | |
| 5073 | + | |
5074 | 5074 | | |
5075 | 5075 | | |
5076 | 5076 | | |
| |||
5134 | 5134 | | |
5135 | 5135 | | |
5136 | 5136 | | |
5137 | | - | |
| 5137 | + | |
5138 | 5138 | | |
5139 | 5139 | | |
5140 | 5140 | | |
5141 | 5141 | | |
5142 | 5142 | | |
5143 | | - | |
| 5143 | + | |
5144 | 5144 | | |
5145 | 5145 | | |
5146 | 5146 | | |
| |||
0 commit comments