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

XX is not a valid line for pointer #42

Open
jbabijczuk opened this issue Feb 17, 2016 · 2 comments
Open

XX is not a valid line for pointer #42

jbabijczuk opened this issue Feb 17, 2016 · 2 comments

Comments

@jbabijczuk
Copy link

There is a problem with nested functions.

Scenario

  • two nested functions with the same name in different units.
  • one of this function is located further than end of file with second function
  • functions has problem with Complexity
    Results:
    XX is not a valid line for pointer

Example in attached file.

I added this code

if ((activeFunction != null) && (activeFunction.getUnit() != results.getActiveUnit()))
        activeFunction = null;

in method FunctionInterface createFunction(CodeAnalysisResults results, ClassInterface currentClass)

It solved this problem but it is not a good solution :(

.
Desktop.zip

@jbabijczuk
Copy link
Author

Better solution:

private FunctionInterface getCachedFunction(CodeAnalysisResults results)
  {
      FunctionInterface activeFunction = results.getCachedFunction(functionName);
      if (activeFunction == null)
          return null;
      if (activeFunction.getUnit() != results.getActiveUnit())
          return null;
      if ((results.getParseStatus() == LexerMetrics.IMPLEMENTATION) && (!activeFunction.isDeclaration()))
          return null;
      return activeFunction;
  }

  private FunctionInterface createFunction(CodeAnalysisResults results, ClassInterface currentClass) 
  {
    FunctionInterface activeFunction = getCachedFunction(results);

    if (activeFunction == null)

@panga
Copy link

panga commented Mar 14, 2016

@jbabijczuk thanks for the fix, I think it worked, but I found another annoying bug!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants