Closed tholin closed 9 years ago
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:-)
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
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!
==========================================================================================
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
Thanks for the quick fix. Problem resolved.
Parsing the Linux kernel will crash with an error like this:
The problem is in the file
drivers/isdn/hardware/avm/avmcard.h
Here is a small cutoutThe crash seems to be caused by those
<-
in the comment sections.