PVS-Studio analysis identifies code defects in Scilab
An analysis of Scilab at commit 30a3695a using PVS-Studio 8.00 highlights memory-management, type-checking, bounds-checking and copy-paste defects.
PVS-Studio analyzed the open-source, cross-platform Scilab project, which is used for scientific and engineering computing. The review examined the code at commit 30a3695a with PVS-Studio 8.00 and selected several notable diagnostics.
Among the examples were releasing memory allocated with new by using delete[] instead of delete, evaluating a potentially unsafe cast because bitwise | was used instead of short-circuit ||, and comparing an array size with itself. The latter check always evaluates as false and can allow mismatched arrays to reach an out-of-bounds loop.
The analysis also identified a duplicated SCSINT32_N branch that leaves the uint32 case unreachable, a repeated map key, and redundant assignments. These examples illustrate how static analysis can expose defects that may otherwise persist alongside testing and code review.