GithubHelp home page GithubHelp logo

Comments (5)

terryyin avatar terryyin commented on July 19, 2024

Thanks for the bug report. I've fixed it.

The bug wasn't because of the content of the comment, but the macro definition. Lizard tried to read until the end of the line with it starts with #,

I've made a new release in pypi.

Please kindly verify the fix and close the issue. Thanks:-)

from lizard.

tholin avatar tholin commented on July 19, 2024

The fix works for avmcard.h but now I get another crash in lib/div64.c
Here is another cutout.

uint32_t __attribute__((weak)) __div64_32(uint64_t *n, uint32_t base)
{
    uint64_t rem = *n;
    uint64_t b = base;
    uint64_t res, d = 1;
    uint32_t high = rem >> 32;

    while ((int64_t)b > 0 && b < rem) {
        b = b+b;
        d = d+d;
    }

    do {
        if (rem >= b) {
            rem -= b;
            res += d;
        }
        b >>= 1;
        d >>= 1;
    } while (d);
}
Traceback (most recent call last):
  File "/home/cocobo/repository/lizard/lizard", line 6, in <module>
    lizard_main(sys.argv)
  File "/home/cocobo/repository/lizard/lizard.py", line 942, in lizard_main
    printer(result, options)
  File "/home/cocobo/repository/lizard/lizard.py", line 819, in print_result
    code_infos, option.extensions, scheme)
  File "/home/cocobo/repository/lizard/lizard.py", line 787, in print_and_save_modules
    for module_info in all_modules:
  File "/home/cocobo/repository/lizard/lizard.py", line 643, in __call__
    filename, open(filename, 'rU').read())
  File "/home/cocobo/repository/lizard/lizard.py", line 654, in analyze_source_code
    for _ in tokens:
  File "/home/cocobo/repository/lizard/lizard.py", line 630, in token_processor_for_function
    reader.state(token)
  File "/home/cocobo/repository/lizard/lizard.py", line 323, in state
    self._state(token)
  File "/home/cocobo/repository/lizard/lizard.py", line 456, in _state_template_in_name
    if self.bracket_stack.pop() != "<":
IndexError: pop from empty list

from lizard.

terryyin avatar terryyin commented on July 19, 2024

Ok. Fixed and I've tested it against the linux kernel myself.
It took like 3 minutes with a -t8 option on my computer.

thanks!

from lizard.

terryyin avatar terryyin commented on July 19, 2024
==========================================================================================
Total nloc  Avg.nloc  Avg CCN  Avg token  Fun Cnt  Warning cnt   Fun Rt   nloc Rt
------------------------------------------------------------------------------------------
   9849441        20     4.38     136.23   357394        14824      0.04    0.22

from lizard.

tholin avatar tholin commented on July 19, 2024

Thanks for the quick fix. Problem resolved.

from lizard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.