Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

As a developer I want to have guards in dataflow analysis #464

Closed
mmews-n4 opened this issue Jan 17, 2018 · 0 comments
Closed

As a developer I want to have guards in dataflow analysis #464

mmews-n4 opened this issue Jan 17, 2018 · 0 comments
Assignees

Comments

@mmews-n4
Copy link
Contributor

mmews-n4 commented Jan 17, 2018

Make flow analysis aware of conditions of branches (e.g. if statements).

Again, this has to be "demonstrated" with the null-analysis.

The guards do not have to be complete (gaps need to be documented though), but they must be correct.

Acceptance Criteria

foo() {
  val a;
  // XPECT warnings
  a.tString();
  // ...
  if (a) { // and other variations of null-check
   // XPECT no warnings
    a.toString();
  }
@mmews-n4 mmews-n4 self-assigned this Jan 17, 2018
mmews-n4 added a commit that referenced this issue Jan 30, 2018
Conflicts:
	plugins/org.eclipse.n4js/src/org/eclipse/n4js/misc/DestructureHelper.xtend
mmews-n4 added a commit that referenced this issue Feb 5, 2018
Conflicts:
	plugins/org.eclipse.n4js/META-INF/MANIFEST.MF
	plugins/org.eclipse.n4js/src/org/eclipse/n4js/typesystem/n4js.xsemantics
	plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/helper/N4JSLanguageConstants.java
	plugins/org.eclipse.n4js/src/org/eclipse/n4js/validation/validators/N4JSFunctionValidator.xtend
	testhelpers/org.eclipse.n4js.ui.tests.helper/src/org/eclipse/n4js/tests/builder/AbstractBuilderParticipantTest.java
	testhelpers/org.eclipse.n4js.ui.tests.helper/src/org/eclipse/n4js/tests/util/ProjectUtils.java
mmews-n4 added a commit that referenced this issue Feb 7, 2018
* NPE bug fix for CFG view

* adds several prototypical analysers for data flow issues

* refactoring: extracted and renamed enum

* first classes for dataflow engine

* renaming adjustments

* added infrastructure for calls to visitEffect of DataFlowVisitors

* added AliasTable, worked on data flow engine, i.e. DataFlowVisitor

* assumptions track aliases on their own

* first prototype of NullDereference analysis

* improved hash methods using cache. worked on null ref analysis

* intermediate state of analysing destructuring patterns

* moved DestructNode and DestructureHelper

* Null dereference analysis works on destructuring patterns

* Null dereference analysis differentiates between may/must

* clean-up and documentation

* fixed errors in DestructNode

* data flow due to destructuring respected

* factored out a class

* simple case of indirect intra-procedural aliases works

* intraprocedural aliases supported

* refactoring moved files to package 'dataflow'

* added Symbols for this and super; refactored SymbolFactory

* replaced assert statements with guava checks

* renamed package from analyses to analysis to be analog to validation pck

* refactored flowgraph validation into separate validator

* factored out findreference method into helper

* refactoring: renaming and improved API

* support for transitive aliases

* refactored test files

* added null/undefined tests

* fixed duplicated warnings. (work in progress)

* added tests

* adjusted post processing of null/undefined analysis

* added tests

* disable following of dead code

* deactivated null/undefined warnings in tests as default

* fixes xpect method for find references

* refactorings

* deactivated support for ParameterizedPropertyAccessExpressions

* removed static set of all symbols

* fixes for smoke tests

* re-activated data flow analysis

* fixed null/undefined warning

* ignoring in tests: "Variable unused" and "Null/Undefined dereference"

* refactoring and java doc

* added edge types after if-condition. added getter for TraverseDirection

* first steps to guard implementation

* added test for disabled warnings in test-folders

* improved guards

* added more tests on null/undefined

* refactoring and enhancements

* copyright year change

* some changes addressing reviewers comments. other changes on GH-464

* refactoring and improvements according to comments on GH-331c

* adjusted tests

* adjusted interpretation of boolean guards

* refactoring and javadoc

* added tests

* extracted DestructureUtils from N4JSASTUtils

* improved dataflow on destructuring patterns and conditional expressions

* adjusted tests to new message

* improved truthy warnings on destructuring

* deeper reasoning about falsy, null and undefined

* deleted old copy

* reverted accidentally removed code

* lots of improvements and adjustments

* small refactorings and added some javadoc

* refactoring, clean-ups, javadoc

* added some corner case tests

* small clean-ups and refactorings

* implemented used before declared with data flow API. refactorings.

* hopefully this fixes merge conflicts

* adjusted flow graph tests

* separated guard creation from symbol creation

* preparations for type guards

* fixed wrong merge solution

* fixed issue in broken AST cases

* activated all xpect tests again

* fixed bug when using 'break l;' in a plain block

* added java doc

* many different changes: flag for dataflow, improved instanceofguard, etc

* renamed some methods in DestructureUtils
@mmews-n4 mmews-n4 closed this as completed Feb 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant