Commit Graph

29908 Commits

Author SHA1 Message Date
Dave Bartolomeo
6d3d9025f7 Merge pull request #867 from jbj/ir-ignoreExprAndDescendants-perf
C++: Replace FastTC with iteration in ignoreExpr
2019-02-04 09:26:32 -08:00
Dave Bartolomeo
7345c921d9 Merge pull request #857 from jbj/ir-getInstruction
C++: Fix TranslatedElement.getInstruction perf
2019-02-04 09:24:00 -08:00
Robert Marsh
411c285aa3 Merge pull request #870 from jbj/ir-shortestDistances
C++: Use shortestDistances HOP for IR BB indexes
2019-02-04 09:19:15 -08:00
Robert Marsh
3a092faebf Merge pull request #865 from p-snft/large-parameter-const-reference
Fix reccomendation for LargeParameter (C++)
2019-02-04 09:18:03 -08:00
Tom Hvitved
13503d068c C#: Use matchesHandle() instead of getLabel() 2019-02-04 16:20:47 +01:00
Asger F
79b9784b08 JS: handle ES2015 modules compiling to Node.js modules 2019-02-04 14:26:24 +00:00
Asger F
5e10e955ee JS: update trivial TRAP changes 2019-02-04 14:25:05 +00:00
Asger F
4b32d8c63f JS: refactor SourceType/Platform 2019-02-04 14:24:39 +00:00
Asger F
ac6b9d1282 JS: add TRAP test with closure modules 2019-02-04 14:24:39 +00:00
Asger F
cac09cf154 JS: Update TRAP output 2019-02-04 14:24:39 +00:00
Asger F
be105b6348 JS: add dbscheme upgrade script 2019-02-04 14:21:34 +00:00
Asger F
8f3b0f584a JS: Extract predicates for ES2015/closure modules 2019-02-04 14:21:34 +00:00
Asger F
51fe31d049 JS: fix FPs in DeadStoreOfLocal 2019-02-04 14:21:34 +00:00
Asger F
6a451a6b53 JS: Fix InvalidExport.ql 2019-02-04 14:21:34 +00:00
Asger F
72fe63074a JS: convert tabs to spaces 2019-02-04 14:21:34 +00:00
Asger F
df88534b36 JS: use PropWrite in exports() predicate 2019-02-04 14:21:34 +00:00
Asger F
c707935841 JS: add Closure::moduleImport and Closure::moduleMember 2019-02-04 14:21:34 +00:00
Asger F
82c0756248 JS: autoformat 2019-02-04 14:21:34 +00:00
Asger F
2ae926462c JS: Move closure code into a module 2019-02-04 14:21:34 +00:00
Asger F
6bcae5e7c2 JS: address comments 2019-02-04 14:21:34 +00:00
Asger F
9fd4e81f20 JS: add change note 2019-02-04 14:21:34 +00:00
Asger F
6a63c3f149 JS: raise precision of global accesses 2019-02-04 14:21:34 +00:00
Asger F
9589ccd40d JS: support imports/exports for closure library code 2019-02-04 14:21:34 +00:00
Asger F
30ba7aedfe JS: split SourceType.MODULE into two 2019-02-04 14:21:34 +00:00
Asger F
f00b16e500 JS: recognize Closure modules files as modules 2019-02-04 14:21:34 +00:00
Tom Hvitved
b4b6fdd12b C#: Revert recent change to AccessorCall
The recent change to `AccessorCall` on dd99525566 resulted
in some bad join-orders, so I have (partly) reverted them. This means that the issues
orignally addressed by that change are now reintroduced, and I plan to instead apply a
fix to the CFG, which--unlike the original fix--should be able to handle multi-property-tuple
assignments.
2019-02-04 15:14:18 +01:00
calum
d79201ec47 C#: Change notes. 2019-02-04 12:53:18 +00:00
calum
7d17724cae C#: The empty string is not considered a format string for this query. 2019-02-04 12:53:12 +00:00
calum
eb0036172e C#: Add test for false-positive. 2019-02-04 12:30:43 +00:00
Jonas Jensen
45a995ba52 C++: Accept test changes from last commit 2019-02-04 13:00:28 +01:00
calum
f8870e78e7 C#: Fix test. 2019-02-04 11:51:04 +00:00
semmle-qlci
e195ac996e Merge pull request #868 from xiemaisi/js/discard-tokens-early
Approved by esben-semmle
2019-02-04 11:32:03 +00:00
Taus
32cc7c7cd9 Merge pull request #858 from markshannon/python-a-few-more-unknowns
Python: Slight improvement to reachability in points-to
2019-02-04 12:14:50 +01:00
Nick Rolfe
fa07364214 Vim syntax highlighting and file-type detection 2019-02-04 10:48:32 +00:00
Jonas Jensen
8368c37781 C++: Use shortestDistances HOP for IR BB indexes
This doesn't make it much faster, but it reduces the debug output
volume. It also simplifies the code.

I've found this change necessary when I compute the full IR on a
Wireshark snapshot in QL4E. Without it, Eclipse runs out of memory
because the console log is too large.
2019-02-04 11:40:11 +01:00
Tom Hvitved
910995af90 C#: Autoformat QL code 2019-02-04 10:32:30 +01:00
Max Schaefer
7be3336aaf JavaScript: Document per-function caches in CFG extractor. 2019-02-04 08:17:21 +00:00
Max Schaefer
6ad45b2451 JavaScript: Temporarily remove unstable test. 2019-02-04 08:10:39 +00:00
Jonas Jensen
60141bf317 C++: ignoreExprAndDescendants QL-796 workaround
The new predicate `isOrphan` gets inlined into
`ignoreExprAndDescendants`, whose performance improves from

    TranslatedElement::ignoreExprAndDescendants#f .. 23.4s (executed 9 times)

to

    TranslatedElement::ignoreExprAndDescendants#f ... 4.3s (executed 9 times)

This dramatic improvement is not only due to eliminating a type check in
the recursive case. Removing the type check from the other base cases
also enabled them to get better join orders.
2019-02-03 16:55:12 +01:00
Jonas Jensen
66e7c26d4e C++: Replace FastTC with iteration in ignoreExpr
Before, `ignoreExprAndDescendants` and its related predicates had this
timing on Wireshark.

    #TranslatedElement::getRealParent#ffPlus#swapped ......... 25.7s
    TranslatedElement::ignoreExprAndDescendants#f ............ 16.9s
    TranslatedElement::getRealParent#ff ...................... 7.2s
    TranslatedElement::ignoreExpr#f .......................... 4.8s
    TranslatedElement::ignoreExpr#f#antijoin_rhs ............. 3.2s
    TranslatedElement::getRealParent#ff_10#higher_order_body . 2.2s

After, it looks like this

    TranslatedElement::ignoreExprAndDescendants#f ............ 23.4s (executed 9 times)
    TranslatedElement::getRealParent#ff ...................... 6.3s
    TranslatedElement::ignoreExpr#f#antijoin_rhs ............. 4.8s
    TranslatedElement::ignoreExpr#f .......................... 3.7s
    TranslatedElement::getRealParent#ff_10#join_rhs .......... 2.5s
    project#TranslatedElement::getRealParent#ff .............. 1.3s
2019-02-03 16:55:12 +01:00
Patrik Schönfeldt
ac249cdbbe Fix reccomendation for LargeParameter (C++)
The previous reccomentation changed the behaviour of the code.
A user following the advice might have broken her/his code:
With call-by-value, the original parameter is not changed.
With a call-by-reference, however, it may be changed. To be sure,
nothing breaks by blindly following the advice, suggest to pass a
const reference.
2019-02-03 15:44:13 +01:00
Jonas Jensen
f8318ef96f C++: Move TIRVariable to its own file
The `SSAConstruction.getNewIRVariable` was very slow on Wireshark. This
was probably because it couldn't join on multiple columns
simultaneously. Instead of improving the join, I observed that the
`TIRVariable` type was the same between all three IR stages except for a
few occurrences of `FunctionIR` that could easily be changed to
`Function`. By sharing `TIRVariable` between all the stages, we avoid
recomputing it and translating it between every stage, turning the slow
`getNewIRVariable` predicate into a no-op.

This change means that later stages of the IR can't introduce new
variables, but that was already the case because
`config/identical-files.json` forced all three `IRVariable.qll` files to
be identical.
2019-02-03 13:36:30 +01:00
Jonas Jensen
3afefce8ef C++: Improve order of parameters in SSA def/use
This changes the order so the parameter that's sometimes projected away
is the last one, making the projection cheap.
2019-02-03 13:34:02 +01:00
Jonas Jensen
4ac22253eb C++: Speed up variableLiveOnEntryToBlock in IR
This predicate computed a local CP between all defs and uses of the same
virtual variable in a basic block. This wasn't a problem in
`unaliased_ssa`, but it became a huge problem in `aliased_ssa`, probably
because many variables can be modelled with a single virtual variable
there.

Before this commit, evaluation of `aliased_ssa`'s
`variableLiveOnEntryToBlock#ff#antijoin_rhs` on Wireshark took 80
_minutes_. After this commit, that predicate and its immediate
dependencies take around 5 _seconds_.
2019-02-03 13:25:18 +01:00
jf205
6243c722c6 Merge pull request #861 from jbj/revert-dbscheme-docs
C++: Revert doc-related changes to dbscheme
2019-02-01 10:59:18 +00:00
Max Schaefer
9bfde9553d Merge pull request #839 from asger-semmle/field-propwrite
JS: add PropWrites cases for instance fields initialization
2019-02-01 10:56:25 +00:00
semmle-qlci
222738072d Merge pull request #840 from esben-semmle/js/propagate-sound-avalue
Approved by xiemaisi
2019-02-01 09:23:43 +00:00
Jonas Jensen
e81d197ebd C++: Revert doc-related changes to dbscheme
These changes to the dbscheme were made in 7cc1442ecb and a98aae0a24
without a corresponding upgrade script in the internal repo.
2019-02-01 10:01:29 +01:00
Jonas Jensen
ee4526687d Merge pull request #859 from rdmarsh2/rdmarsh/cpp/ir-performance-1
C++: use field overrides in TranslatedElement and subclasses
2019-02-01 08:43:20 +01:00
Robert Marsh
e1d289ffb4 Merge pull request #759 from calumgrant/cs/interface-tostring
C#: Remove FPs from cs/call-to-object-tostring
2019-01-31 12:03:49 -08:00