Commit Graph

5051 Commits

Author SHA1 Message Date
Martin Mohr e78e71fe71 fetch dexlib-1.3.4.jar from SCanDroid
This buys us some time to work on a proper solution, aka:
porting from dexlib to dexlib2
2017-01-03 18:09:23 +01:00
Manu Sridharan 63e3f82d38 Revert "fetch dexlib-1.3.4.jar from SCanDroid"
This reverts commit fc31fce698.
2017-01-02 16:12:53 -08:00
Martin Mohr fc31fce698 fetch dexlib-1.3.4.jar from SCanDroid
This buys us some time to work on a proper solution, aka:
porting from dexlib to dexlib2
2017-01-02 16:05:43 -08:00
Manu Sridharan f42ad7aea6 Fix #127
Check that we only loop over the parameters actually being passed at
the call site in the SDG construction.
2017-01-02 15:36:38 -08:00
Martin Mohr b9fb5e0481 display which classes each handler catches when outputting IR 2016-12-09 16:49:56 +01:00
Martin Mohr 4228bac5ff If we see a call to an unknown method, conservatively add edges to all catch handlers
This is an attempt to fix issue #123
2016-12-09 16:46:01 +01:00
Martin Mohr ee22e177c5 Dalvik-Frontend: add catch-all handler at the end and not at the beginning 2016-12-09 16:40:14 +01:00
Martin Hecker d5dee55918 correctly prune safe array creation for multi-dimensional array creation 2016-12-07 19:27:59 +01:00
Martin Mohr f7299b003b fix compilation problems caused by merge 2016-12-07 17:56:59 +01:00
Martin Hecker 4905695e4a more interprocedural NullPointerException test cases 2016-12-07 17:56:59 +01:00
Martin Hecker 64c4034dca fix: properly propagate NullPointerState along phi nodes in the NullPointerExceptionAnalysis 2016-12-07 17:56:59 +01:00
Martin Hecker 7293d18a89 another test case for the NullPointerException analysis 2016-12-07 17:56:59 +01:00
Martin Hecker c7f618eb6f add some tests both for intra and inter-procedural NullPointerException Analysis 2016-12-07 17:56:59 +01:00
Martin Hecker 4fca71c595 some more simple tests for intraprocedurel NullPointerException Analysis 2016-12-07 17:56:59 +01:00
Martin Hecker edf4f8ed6f Attempt to fix intraprocedural Nullpointer analysis by respecting phi nodes, and correctly initializing entry variables.
Since  SSAPhiInstructions are never visited by NullPointerTransferFunctionProvider.TransferFunctionSSAVisitor,
we now respect phi instructions present at a given block by providing additional NodeTransferFunctions, improving precision.

Formerly, meets would lead to incorrect results due to incorrect initialization of initial data flow facts.

These are now properly initialized, interpreting
  "State.BOTH" to mean: both "null" and "non-null" are possible values for the given variable, and
  "State.UNKNOWN" to be the absurd assertion.

The initial fact at the entry block assumes variables to be BOTH, other blocks are initialy assumed unreachable and hence their variables to be UNKNOWN.
2016-12-07 17:56:48 +01:00
Martin Mohr 6d0ba7d371 Make a variant of TypeInference which supports dalvik bytecode
Dalvik bytecode represents 'null' as 0 which may lead to problems
in phi instructions. This variant of TypeInference fixes these
problems by

- tracking whether an SSA value is constant zero and
- ignoring constant zeros in the transfer function of phi instructions
  when meeting with non-primitive types
2016-12-07 16:34:13 +01:00
Martin Mohr 9ada546c5d Activity.onStop is part of the loop 2016-12-07 16:11:19 +01:00
Martin Mohr 9a3e869dd1 use pi nodes in dalvik frontend 2016-12-07 16:11:19 +01:00
Martin Mohr 5624ad78fa really turn off short circuit optimization
The setting should comply with the comment. Plus,
turning it on seems to lead to some unsoundness because
exception points-to sets become empty but should not be
2016-12-07 16:11:19 +01:00
Martin Mohr fd2d4aefbf further fixes in dalvik front-end to avoid NullPointerExceptions and other errors 2016-12-07 16:11:19 +01:00
Martin Mohr 42ae088c05 turn exception throwing into debug logging message 2016-12-07 16:11:19 +01:00
Martin Mohr a8cb767c63 allow action names starting with "."
According to [1], such action names are allowed and implicitly to be
prepended with the package name of the application.

[1] http://developer.android.com/guide/topics/manifest/activity-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr 7c657f5754 allow unqualified custom actions 2016-12-07 16:11:19 +01:00
Martin Mohr be635cf50d support for activity aliases 2016-12-07 16:11:19 +01:00
Martin Mohr 92f26a33c2 clarification 2016-12-07 16:11:19 +01:00
Martin Mohr 95031461f4 handle gracefully the case of intent-filter without action
According to [1], such intent-filters do not let any intent
pass but on the other hand do no harm

[1] http://developer.android.com/guide/topics/manifest/action-element.html
2016-12-07 16:11:19 +01:00
Martin Mohr a1fa8a2057 update intent information instead of crashing 2016-12-07 16:11:18 +01:00
Julian Dolby 891bf3f585 Merge branch 'master' of https://github.com/wala/WALA 2016-12-06 12:50:09 -05:00
Julian Dolby 8fd17b3463 merge 2016-12-06 12:50:04 -05:00
Martin Hecker 867a8ecf2b When creating TypeAnnotations with LocalVarTarget, somewhat deal with class files that lack a LocalVariableTable 2016-12-05 18:52:38 +01:00
Martin Hecker 5f617c19e3 Tests for the new JSR 308 type annotations implementation. 2016-12-05 18:52:38 +01:00
Martin Hecker de0f9c2a1f WALA: Provide acces to JSR 308 Annotations via new Class TypeAnnotation.
Access is provided via corresponding methods in FieldImpl, ShrikeCTMethod and ShrikeClass.
Since we do not currently have implementation of these methods for front-ends other than Shrike, these new methods are not yet made available in the corresponding interfaces.
2016-12-05 18:52:38 +01:00
Martin Hecker 92dc2929f2 Shrike: low level reading of JSR 308 Type Annotations from Java bytecode 2016-12-05 18:52:38 +01:00
Martin Hecker 8e773fcf88 in order to look up instruction-indices from a bytecode-indices, do a binary search on the existing pcMap array (as suggested by Julian Dolby).
also see https://sourceforge.net/p/wala/mailman/message/35518796/ and answers.
2016-12-05 18:52:37 +01:00
Martin Mohr dff20ac49c make JarStreamModule inherit the assumptions of JarInputStream's constructor 2016-12-05 18:50:21 +01:00
Martin Hecker 1b74b906fc Add some tests that are meant to check both for precision and soundness of the intraprocedural NullPointer analyses. 2016-12-05 18:24:39 +01:00
Martin Mohr c00d9ec7af avoid NPE while constructing debug message 2016-12-05 18:23:55 +01:00
Martin Mohr 3283de6c44 promote visibility of some handy but harmless methods 2016-12-05 18:23:55 +01:00
Martin Mohr d830780242 slight fix of type parameter handling in PDG 2016-12-05 18:22:38 +01:00
Martin Mohr c530fc3ae6 once again fix location of apache commons io lib 2016-12-05 18:21:17 +01:00
Juergen Graf 22b7db62f7 make output of dot util compatible with dot viewer eclipse plugin. prevent parser error. 2016-12-05 18:21:17 +01:00
Martin Mohr 4a7efc8c78 array creation is also safe if length comes from another array's length 2016-12-05 18:21:05 +01:00
Martin Mohr 13a7b5459e prune exceptions for array creations of constant, non-negative size 2016-12-05 18:21:05 +01:00
Martin Mohr f989290ca6 provide list of exceptions for array creation sites with non-negative size 2016-12-05 18:21:05 +01:00
Manu Sridharan 9ca450de48 Merge pull request #114 from liblit/error-fix-hamcrest-dependency
Add Hamcrest dependency
2016-12-01 08:56:15 -08:00
Ben Liblit 522c382a19 Use consistent Java versions, usually 1.7
Previously, the various Eclipse projects' Java configurations used
mixtures of 1.6, 1.7, and 1.8.  Many were internally inconsistent,
such as requiring 1.7 in "MANIFEST.MF" but 1.6 in the Eclipse JDT
build preferences.  The Travis-CI configuration tests against both 1.7
and 1.8, but does not test against 1.6.

Across all projects, the most common version was 1.7.  So I'm going to
assume that 1.7 is the intended build target.  This commit makes 1.7
the selected version nearly everywhere.

"com.ibm.wala.core.testdata" is the one exception.  This specific
project uses a few features only found in 1.8, such as lambda
expressions.  Previously, "com.ibm.wala.core.testdata" used 1.7 in
some aspects of its configuration but 1.8 in others.  Now it
consistently targets 1.8.  I wish this one project didn't need to be
inconsistent with the rest of WALA, but at least now it's consistent
with itself.

(Personally, I'd be happy to target 1.8 only.  But my impression
across all of these configuration files is that the WALA developers
still want to be compatible with 1.7.  If that is no longer a
requirement, let me know and I will adjust these changes accordingly
to target 1.8 only.)

This change eliminates 11 "There is no 'jre.compilation.profile' build
entry and the project has Java compliance preferences set" warnings
and 13 "The JRE container on the classpath is not a perfect match to
the 'JavaSE-1.7' execution environment" warnings.  However, it also
adds 450 "Redundant specification of type arguments <...>" warnings
and 17 "Resource '...' should be managed by try-with-resource"
warnings.  So this seems like a net step backward in my wish to reduce
WALA warnings.  However, those new warnings concern Java 1.7 language
features that we were not previously using to good effect in projects
that targeted 1.6.  If we all agree that we can now target 1.7
instead, then we can use these helpful features as the newly-added
warnings suggest.  So I call that a step in the right direction.
2016-11-29 21:29:30 -06:00
Manu Sridharan fc37430c13 Merge pull request #113 from liblit/warning-fixes-xml-validation
Eliminate all Eclipse XML validation warnings
2016-11-29 18:05:09 -08:00
Ben Liblit cc2dcb91a6 Add Hamcrest dependency
Some source files here definitely use Hamcrest, so listing it as a
dependency seems reasonable.  What I find confusing is the inconsistency
among my Eclipse installations.  On some of my various machines, Eclipse
reports an error if this dependency is not listed.  On others, Eclipse
finds the required jar and reports no error, even if this dependency is
not listed.  I don't know why the latter works, or why the inconsistency
exists at all.  Eclipse is a complex, subtle beast.  What I can say is
that this change fixes the error for my Eclipses that were reporting an
error, and does not introduce any new errors for my Eclipses that were
already happy before this change.
2016-11-29 15:12:54 -06:00
Ben Liblit 18b79bf0f9 Merge branch 'master' into warning-fixes-xml-validation 2016-11-29 10:08:00 -06:00
Manu Sridharan 1e5dcf46f7 Merge pull request #112 from liblit/warning-fixes-html-validation
Eliminate all Eclipse HTML validation warnings
2016-11-28 21:37:46 -08:00