Commit Graph

46 Commits

Author SHA1 Message Date
Ben Liblit ebfd885d22 Use modern for-each loops where possible
Java sources used as test data have been excluded from this mass
clean-up.
2017-11-28 14:44:53 -06:00
Ben Liblit 8ef6ad5069 Add proper type parameters to nearly all uses of Iterator
Java sources used as test data have been excluded.
2017-11-28 14:09:30 -06:00
Ben Liblit cb6d3b282a Fix Eclipse warnings about redundant null checks and assignments
Most of these are harmless, and are best fixed simply by removing the
redundant check or assignment.  The one in FlowType.compareBlocks,
however, revealed a real problem.  This code checks for nullness of
`a` *after* having called a method on `a`.  Assuming that `a` can
indeed be `null` here, the check must come first to avoid a
`NullPointerException`.

In several places, I saw code of this form:

   if (thing == null)
     assert thing != null : ... ;

I honestly don't understand the purpose of that `if` statement.  Why
not just have the `assert` statement there directly?  I removed the
seemingly irrelevant `if` statements in these cases, but if this is
some intentional pattern, please explain it to me.

In a few places where nullness is statically known but non-obvious,
add assert statements to point out what's going on to help future
developers.

Upgrade future such warnings to errors to keep us moving in a cleaner
direction.
2017-08-15 09:11:29 -07:00
Julian Dolby eaba8d59b7 Merge branch 'master' of https://github.com/wala/WALA 2017-08-05 21:09:34 -04: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
Julian Dolby c9ad359d65 new test to remind me that prototype no longer works with correlation tracking:
com.ibm.wala.cast.js.rhino.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShapeRhino.java
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestPrototypeCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/pages/prototype.html

work (not yet finished) on fixes to property accesses for JavaScript:
com.ibm.wala.cast/source/java/com/ibm/wala/cast/ipa/callgraph/AstSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.java/src/com/ibm/wala/cast/java/ipa/callgraph/AstJavaSSAPropagationCallGraphBuilder.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/JSSSAPropagationCallGraphBuilder.java

currently unused tests to remind me to fix bugs:
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java
com.ibm.wala.cast.js.test.data/examples-src/tests/loops.js
com.ibm.wala.cast.js.test.data/examples-src/tests/primitive_strings.js

fixes to exception handler code generation in JavaScript:
com.ibm.wala.cast.js.rhino/source/com/ibm/wala/cast/js/translator/RhinoToAstTranslator.java
com.ibm.wala.cast.js.test.data/examples-src/tests/try.js
com.ibm.wala.cast.js.test/harness-src/com/ibm/wala/cast/js/test/TestSimpleCallGraphShape.java

fixes to make the system build on both juno and luna
com.ibm.wala.cast.js.test.data/pom.xml
pom.xml
targets/e42/e42.target
targets/e44/e44.target
targets/pom.xml
com.ibm.wala.core.tests/META-INF/MANIFEST.MF
com.ibm.wala.dalvik.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt.test/META-INF/MANIFEST.MF
com.ibm.wala.ide.jdt/source/com/ibm/wala/cast/java/translator/jdt/FakeExceptionTypeBinding.java
com.ibm.wala.ide.jdt/source/com/ibm/wala/ide/util/JavaEclipseProjectPath.java
com.ibm.wala.ide.jsdt.tests/META-INF/MANIFEST.MF
com.ibm.wala.ide.jsdt.tests/src/com/ibm/wala/ide/jsdt/tests/AbstractJSProjectScopeTest.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/EclipseProjectPath.java
com.ibm.wala.ide/src/com/ibm/wala/ide/util/ProgressMonitorDelegate.java

beginnings of "pointer analysis" on top of field-based analysis
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/FlowGraph.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/PropVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/RetVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VarVertex.java
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/callgraph/fieldbased/flowgraph/vertices/VertexFactory.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/PointerAnalysis.java
com.ibm.wala.core/src/com/ibm/wala/ipa/callgraph/propagation/cfa/ExceptionReturnValueKey.java

fixes for crashes in correlartion tracking
com.ibm.wala.cast.js/source/com/ibm/wala/cast/js/ipa/callgraph/correlations/extraction/ClosureExtractor.java

fixes for Dalvik IR generation
com.ibm.wala.core/src/com/ibm/wala/cfg/BytecodeCFG.java
com.ibm.wala.core/src/com/ibm/wala/cfg/ShrikeCFG.java
com.ibm.wala.core/src/com/ibm/wala/ssa/SSACFG.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/drivers/APKCallGraphDriver.java
com.ibm.wala.dalvik.test/source/com/ibm/wala/dalvik/test/callGraph/JVMLDalvikComparison.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/classLoader/DexCFG.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/dex/instructions/UnaryOperation.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/AbstractIntRegisterMachine.java
com.ibm.wala.dalvik/src/com/ibm/wala/dalvik/ssa/DexSSABuilder.java

fixes to stack map generation when instrumenting for Java 7
com.ibm.wala.shrike/src/com/ibm/wala/shrike/cg/DynamicCallGraph.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/ConstantInstruction.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Analyzer.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/ClassHierarchy.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/analysis/Verifier.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeBT/shrikeCT/ClassInstrumenter.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapConstants.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableReader.java
com.ibm.wala.shrike/src/com/ibm/wala/shrikeCT/StackMapTableWriter.java
2014-10-15 16:01:38 +09:00
Julian Dolby 36709b9d1a java 7 support, with much pain for stack maps :) 2014-10-06 15:34:16 -04:00
Julian Dolby 080325b5f6 merge 2013-06-25 11:57:37 -04:00
Manu Sridharan 256cd06460 Convert all Java source files to use Unix line endings; no semantic change 2012-09-04 15:56:05 -07:00
msridhar1 59e46916ce Generalize certain IR data structures to be less Java-specific. Generalize annotations code to allow for reading annotation parameters. Various other fixes
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4290 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-12-28 17:03:27 +00:00
msridhar1 9aa9187edc fix for CFG bug reported by Benedikt N on mailing list, plus test case
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4077 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-03-24 19:41:46 +00:00
msridhar1 06b652d1fb fix bug reported by Benedikt Nordhoff on mailing list: for cases where an enclosing exception handler catches all exception types, don't add an exceptional edge from a throw instruction to method exit.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@4057 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2011-02-08 23:41:03 +00:00
sjfink 7bb0b09935 refactoring: move IBytecodeMethod to the classloader package
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3664 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-06-12 14:47:30 +00:00
sjfink d36591740a fix bug in ShrikeCFG for resolving exceptional flow with nested catch blocks
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3457 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-14 20:04:43 +00:00
sjfink 77101da20f misc. cleanups
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3434 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-10 19:48:32 +00:00
dolby-oss e80dc6ef8c refactor handling of constants in Shrike to abstract away from Java bytecode
introduce factories to create SSAInstruction objects


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3433 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-04-10 18:33:07 +00:00
sjfink 8257c9a199 organize imports
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3369 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-26 17:23:08 +00:00
dolby-oss 2e65395044 further shrike-related refactoring
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3365 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-24 17:07:44 +00:00
sjfink cc967ff9ae make a few private methods protected, so subclasses may override
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3335 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-17 19:35:47 +00:00
dolby-oss 1b1c7f2b3f further Shrike refactoring to generalize instructions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3274 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-03-11 13:33:00 +00:00
dolby-oss b61135c8be adapt to Shrike changes: divorce SSAInstruction from the Shrike Instruction, which requires adding a type parameter to ControlFlowGraph and propagating that change. Also, stop using the JVML opcode in a few places where it was (unnecessarily) being used.
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3227 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2009-02-19 15:58:31 +00:00
sjfink 4a474024ce small local optimization
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3034 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-09-11 17:23:01 +00:00
sjfink bcec0cce45 small local optimizations
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@3033 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-09-11 17:05:46 +00:00
sjfink 86428f4ba5 bug fixes with TypeReferences and RuntimeException reasoning
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2999 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-08-20 16:08:11 +00:00
sjfink 4af31cd9bd some more assertions
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2813 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-05-12 21:18:42 +00:00
sjfink a3ac4d3a45 bug fix for previous bug fix
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2570 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-13 00:09:46 +00:00
sjfink cce25261d6 bug fix when computing exceptional flow with unresolved exception type
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2528 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-02-01 22:18:30 +00:00
sjfink dc39a8dd86 refactoring: move some classes into appropriate packages
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@2452 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2008-01-24 22:20:38 +00:00
sjfink c0dbd75e4e replace Trace with System.err.println for debugging
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1966 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-10-26 18:18:11 +00:00
sjfink d445f0861a change ControlFlowGraph.getExceptionalSuccessors to return a List, in order of increasing catch scope
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1822 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-10-04 15:48:46 +00:00
sjfink 182a53ee8f generics for control flow graph and filters
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1712 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-09-02 14:45:41 +00:00
sjfink d2764d5672 spelling error in comment
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1692 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-08-30 17:27:32 +00:00
sjfink 059761fb70 use Hash factories everywhere
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1438 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-11 21:08:12 +00:00
sjfink 5eb76541f0 massive overhaul of Warnings management
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1382 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-07-06 22:08:13 +00:00
sjfink b0d31d38cb remove some unnecessary IClassHierarchy parameters
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1254 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-06 20:15:37 +00:00
sjfink 65cc4433cd make some fields final
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1244 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-05 14:01:26 +00:00
sjfink 8e52444761 make many fields final
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1232 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-01 21:38:35 +00:00
sjfink 576251be0c 1) adjust somewhat to recent API changes.
2) fix equals() bug in Statement
3) general cleanups

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1223 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-01 14:06:13 +00:00
dolby-oss 0ed8d96d55 Changes to allow cross-language call graphs. The three biggest changes are as follows:
1) The visitors nested in the SSAPropagationCallGraph have become static classes so that they can be reused in a delegation pattern for the cross-language call graph builder.
2) The ClassHierarchy is now encapsulated behind an IClassHierarchy interface to allow for a CrossLanguageClassHierarchy that delegates to a set of child hierarchies, one for each language.  The internals of the ClassHierarchy are almost entirely unchanged
3) There is now a new Language interface in com.ibm.wala.classLoader, and all IClassLoader objects have to know what language they load for.  This language object now encapsulates a few language-specific options that were previously hacked into the AnalysisOptions object.


git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1212 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-06-01 03:26:18 +00:00
sjfink ea3caa1e8a mostly clean up old comments.
also rename InferGraphRootsImpl to InferGraphRoots

git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1200 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 19:05:23 +00:00
sjfink fdb7a17af3 add @Overrides annotations and nuke unnecessary casts
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1197 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-05-30 15:16:05 +00:00
sjfink a2c7c8d6e4 check arguments to public methods
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@1019 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-04-26 20:35:25 +00:00
sjfink e02937e61b make IBasicBlock an Iterable<IInstruction>. Rename iterateAllInstructions() to iterator()
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@878 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-03-22 10:50:42 +00:00
sjfink e955c1e657 Graph API change: Graph is now an Iterable of Nodes!
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@867 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-03-21 21:07:30 +00:00
sjfink 979451f05c rename Shrike*Wrapper to just Shrike*
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@551 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2007-01-10 20:49:24 +00:00
sjfink df97f42b7e attempt to introduce tags and trunk
git-svn-id: https://wala.svn.sourceforge.net/svnroot/wala/trunk@490 f5eafffb-2e1d-0410-98e4-8ec43c5233c4
2006-11-22 17:38:46 +00:00