Open vtereshkov opened 2 months ago
@marekmaskarinec there's a lot of warnings related to floating point in nav.c
, you should review it.
Found more weird floating point comparisons:
https://github.com/marekmaskarinec/tophat/blob/main/src/particles.c#L88
https://github.com/marekmaskarinec/tophat/blob/main/src/particles.c#L77
https://github.com/marekmaskarinec/tophat/blob/main/src/particles.c#L52
(why are we subtracting p->angle.x
and adding it back?)
I'll stop for now; I'll try to run the analyzer again myself later, and probably use a better tool to sort through the warnings than just looking at the raw JSON output.
I ran a static analyzer on tophat sources. For me, nothing criminal was found, but I wasn't very careful, so you can also take a look at the report.
I see a lot of
malloc()
results not checked forNULL
(not a severe crime on modern PCs), floating-point values compared to an exact 0.0 (not a severe crime either if you know what you do), a lot of false positives where the analyzer fails to see alongjmp()
in Umka.Besides that, I found two suspicious places in the report, maybe due to copy-pasting:
See the detailed report here: Analysis_Report.json