Commit Graph

29 Commits

Author SHA1 Message Date
Tom Hvitved
9e67382f06 Bump codeql submodule 2021-09-15 14:59:42 +02:00
Harry Maclean
4763312e55 Merge ConditionBlock and BarrierGuard 2021-09-14 11:11:12 +01:00
Harry Maclean
6f32401e5c Add unless x != test to barrier guards
This tests that the following call to `foo bar` is guarded:

    unless bar != "bar"
      foo bar
    end
2021-09-13 11:58:17 +01:00
Harry Maclean
800e18349f Add != to StringConstCompare
This means we treat != comparisons against strings as taint tracking guards:

    if foo != "A"
      foo         # still tainted
    else
      foo         # not tainted, because we know foo == "A"
    end
2021-09-10 16:42:45 +01:00
Harry Maclean
b4c29425ea Make barrier guards more specific
Following examples from the other libraries, this change introduces a
member predicate `checks(CfgNode expr, boolean branch)` to
`BarrierGuard`, which holds if the guard validates `expr` for a
particular value of `branch`, which represents the value of the
condition in the guard.

For example, in the following guard...

    if foo == "foo"
      do_something foo
    else
      do_something_else foo
    end

...the variable `foo` is validated when the condition `foo == "foo"` is
true.

We also introduce the concept that a guard "controls" a code block based
on the value of `branch`. In the example above, the "then" branch of the
if statement is controlled when `branch` is true. The else branch is
not controlled because `foo` can take (almost) any value in that branch.

Based on these concepts, we define a guarded node to be a read of a
validated variable in a controlled block.

In the above example, the `foo` in `do_something foo` is guarded, but
the `foo` in `do_something_else foo` is not.
2021-09-09 11:04:52 +01:00
Tom Hvitved
ae70af01cd API graphs: Fix bug for resolvable modules 2021-09-01 16:57:52 +02:00
Tom Hvitved
031a73ff0f Add API graph test that exhibits a missing edge 2021-09-01 16:56:09 +02:00
Arthur Baars
ac2c315839 Fix merge conflicts during rebase 2021-08-26 18:48:53 -04:00
Tom Hvitved
ae837d9f7a API graphs: Remove restriction on top-level constants 2021-08-09 12:59:36 +02:00
Tom Hvitved
8451286754 API graphs: Remove MkModule 2021-08-04 10:28:30 +02:00
Arthur Baars
efde1f86d9 Fix test case 2021-06-25 10:59:10 +02:00
Arthur Baars
6bed50a86b Rename predicate with snake cased name 2021-06-24 11:59:13 +02:00
Arthur Baars
f18e5030e0 Address comments by @tausbn 2021-06-22 17:25:34 +02:00
Arthur Baars
f0c83288a7 Add test case for ApiGraph 2021-06-21 19:37:41 +02:00
Tom Hvitved
61e35ddae1 Data flow: Call-sensitive resolution of lambda/block calls 2021-06-04 12:58:38 +02:00
Tom Hvitved
5bafc0c708 Merge pull request #183 from github/hvitved/assign-op-desugar
Desugar setter assignments
2021-06-01 14:00:04 +02:00
Tom Hvitved
e85677a040 Adjust locations of synthesized AST nodes 2021-05-25 21:27:34 +02:00
Arthur Baars
0ccca47b01 Dataflow for implicit self argument of methods 2021-05-20 14:27:13 +02:00
Arthur Baars
da88661746 Add SSA flow step for parameters 2021-05-20 14:27:13 +02:00
Nick Rolfe
778de741d0 Merge remote-tracking branch 'origin/main' into cfg_cleanup 2021-05-17 16:26:28 +01:00
Tom Hvitved
ff06e724b1 AST synthesis framework 2021-05-12 19:58:52 +02:00
Nick Rolfe
2569bf257f Make CFG for TThen post-order 2021-05-07 15:40:50 +01:00
Tom Hvitved
0bb5007103 Reintroduce hidden then/else/do in AST; include all in CFG 2021-03-25 14:22:35 +01:00
Nick Rolfe
2eb8757285 Update expected test output for toString changes 2021-02-16 15:41:05 +00:00
Arthur Baars
0f6854301e Dataflow: identify ReturnNodes 2021-02-10 18:26:11 +01:00
Arthur Baars
d69aa96f23 More tests 2021-02-10 18:26:11 +01:00
Arthur Baars
bb89e134c4 Address comments 2021-02-09 13:54:46 +01:00
Arthur Baars
a752491c5f Add flow steps for loop 'return' values 2021-02-08 19:06:07 +01:00
Arthur Baars
83bcd26244 Add dataflow step tests 2021-02-04 16:09:50 +01:00