Commit Graph

9831 Commits

Author SHA1 Message Date
Chris Smowton
8406ee7ed5 Add test for a pattern-switch guard acting as a data-flow guard 2023-11-30 11:23:59 +00:00
Chris Smowton
144218e2f7 Implement switch CFG when there are mixed constant and pattern cases 2023-11-30 11:23:59 +00:00
Chris Smowton
54a89d6fef Handle 'case null, default:' 2023-11-30 11:23:59 +00:00
Chris Smowton
9a450b09be Account for pattern-cases in more places 2023-11-30 11:23:59 +00:00
Chris Smowton
2b16121638 CFG: Support guarded patterns 2023-11-30 11:23:59 +00:00
Chris Smowton
ba0f3cf718 Add basic support for case guards 2023-11-30 11:23:59 +00:00
Chris Smowton
e94c5a772c Check nullness pass knows pattern case variables can't be null 2023-11-30 11:23:59 +00:00
Chris Smowton
ca43b9603a Fixup typeflow test 2023-11-30 11:23:59 +00:00
Chris Smowton
6b9aed21df Nullness library: recognise switches with null checks 2023-11-30 11:23:58 +00:00
Chris Smowton
79b77ae805 Add AST test for switch with null case 2023-11-30 11:23:58 +00:00
Chris Smowton
05caffc189 Update printast expectation 2023-11-30 11:23:58 +00:00
Chris Smowton
30c5885966 Fix constant cases relating to enum types 2023-11-30 11:23:58 +00:00
Chris Smowton
b21aaa75bc Type-flow: treat pattern-switch on an array index similar to instanceof 2023-11-30 11:23:58 +00:00
Chris Smowton
7dd4030f51 Pattern cases: support type-flow 2023-11-30 11:23:58 +00:00
Chris Smowton
a06ac42512 PrintAst: report pattern-cases similar to pattern-instanceof 2023-11-30 11:23:58 +00:00
Chris Smowton
b6622d2f5b usesType: support pattern cases 2023-11-30 11:23:58 +00:00
Chris Smowton
0f434e7f08 Add test for dataflow vs. pattern-switch 2023-11-30 11:23:58 +00:00
Chris Smowton
6c990c2cf6 Add pattern-case support and generally debug switch CFGs
These were reasonably broken beforehand, due to not taking switch rules into account in enough places, and confusing the expression/statement switch rule distinction with the distinction between switch statements and expressions.

(For example, `switch(x) { 1 -> System.out.println("Hello world") ... }` is a statement, but has a rule expression).
2023-11-30 11:23:58 +00:00
Chris Smowton
f4b45fa511 Support switch cases with binding patterns 2023-11-30 11:23:58 +00:00
Jami Cogswell
7e869b9cd1 Java: add change note 2023-11-29 16:48:57 -05:00
Jami Cogswell
d5fd2db1bd Java update UrlPathHelper tests 2023-11-29 15:23:11 -05:00
Jami Cogswell
ba3548b317 Java: switch to createRelative sink and add UrlPathHelper sources 2023-11-29 14:46:28 -05:00
Jami Cogswell
efa5ab18c1 Java: add taint steps for getResource sink 2023-11-29 14:46:27 -05:00
Chris Smowton
e110db58f8 Add test for empty argfile 2023-11-29 12:51:22 +00:00
Ian Lynagh
7560573b89 Merge pull request #14906 from igfoo/igfoo/locs
Kotlin 2: Accept some location changes in test-kotlin2/library-tests/stmts
2023-11-27 11:42:47 +00:00
Stephan Brandauer
68a7734e08 Merge pull request #14849 from github/kaeluka/automodel-extraction-skip-primitive-types-candidates
Java Automodel extraction: remove primitives in framework mode
2023-11-27 09:52:48 +01:00
Stephan Brandauer
2e5971bb57 Java automodel: also drop boxed types and number types from endpoints 2023-11-24 15:04:13 +01:00
Ian Lynagh
b33fcf3719 Kotlin: Accept some location changes in test-kotlin2/library-tests/stmts 2023-11-24 13:34:44 +00:00
Ian Lynagh
c4d3d505ca Kotlin: Accept changes in Kotlin2 ExtractorInformation test 2023-11-23 14:30:50 +00:00
Ian Lynagh
1f2d9dc95c Merge pull request #14862 from igfoo/igfoo/test-kotlin1
Kotlin: Move tests from test/kotlin to test-kotlin1
2023-11-22 14:45:13 +00:00
Tom Hvitved
1a6886cf99 SSA: Add locations to ease debugging 2023-11-22 08:37:02 +01:00
Ian Lynagh
45bbcccd1a Kotlin: Copy TestUtilities into the kotlin testsuites 2023-11-21 17:16:54 +00:00
Ian Lynagh
1fb19191ba Kotlin: Add a qlpack.yml to the test-kotlin1 tests 2023-11-21 15:31:18 +00:00
Ian Lynagh
f48cc1a526 Kotlin: Move tests from test/kotlin to test-kotlin1
Matches test-kotlin2
2023-11-21 15:28:12 +00:00
Stephan Brandauer
f2de449ce4 Merge branch 'main' into kaeluka/automodel-extraction-skip-primitive-types-candidates 2023-11-21 14:57:24 +01:00
Ian Lynagh
2c2dccabe9 Merge pull request #14833 from igfoo/igfoo/kot2tests
Kotlin: Add a kotlin2 copy of the testsuite
2023-11-21 12:24:49 +00:00
Max Schaefer
b5c92408f4 Merge pull request #14845 from github/max-schaefer/minor
Automodel: Fix a few nits.
2023-11-20 15:24:45 +00:00
Stephan Brandauer
737aab66f5 Java automodel: drop primitive parameters from endpoints 2023-11-20 15:09:05 +01:00
Stephan Brandauer
e34a9de008 Java Automodel: drop return values of primitive return type methods from consideration for extraction in framework mode 2023-11-20 14:11:14 +01:00
Stephan Brandauer
212a515fa9 Java Automodel: drop return values void methods other than ctors from consideration for extraction in framework mode 2023-11-20 14:00:59 +01:00
Stephan Brandauer
d84501d65c Java automodel extraction: test case for framework mode extraction showing how primitives are currently candidates 2023-11-20 13:36:41 +01:00
Max Schaefer
1bed9f9003 Automodel: Fix a few nits. 2023-11-20 11:06:02 +00:00
Arthur Baars
db180d9872 Merge pull request #14823 from github/post-release-prep/codeql-cli-2.15.3
Post-release preparation for codeql-cli-2.15.3
2023-11-19 12:13:42 +01:00
github-actions[bot]
bad499e360 Post-release preparation for codeql-cli-2.15.3 2023-11-17 14:35:41 +00:00
Ian Lynagh
007f181ff5 K2: library-tests/properties: Accept loc changes 2023-11-17 14:07:15 +00:00
Ian Lynagh
90ba3812fe K2: library-tests/private-anonymous-types: Accept loc changes 2023-11-17 14:07:15 +00:00
Ian Lynagh
e63ddd2071 K2: library-tests/operator-overloads: Accept changes 2023-11-17 14:07:15 +00:00
Ian Lynagh
8f8f5f8826 K2: library-tests/methods-mixed-java-and-kotlin: Accept loc changes 2023-11-17 14:07:15 +00:00
Ian Lynagh
584ba80ec7 K2: library-tests/literals: Accept changes
Some literals that were negative are now unaryMiunus applied to a
positive literal.
2023-11-17 14:07:15 +00:00
Ian Lynagh
4ad874a089 K2: library-tests/lateinit: Accept loc changes 2023-11-17 14:07:15 +00:00