feat: consolidated PVS-Studio static analysis fixes & documentation update - #89
Open
bivex wants to merge 13 commits into
Open
feat: consolidated PVS-Studio static analysis fixes & documentation update#89bivex wants to merge 13 commits into
bivex wants to merge 13 commits into
Conversation
- Fix potential buffer overflow and bounds check in main.c (preprocess) - Fix termios c_lflag bitmask truncation on 64-bit platforms in mesg.c - Fix potential null pointer dereferences in pangen2.c, pangen3.c, and run.c - Fix undefined behavior in 64-bit bit shift operations (1UL<<j) in pangen6.c - Fix EVAL AST node child type check logic in pangen6.c - Fix code formatting ambiguity in pangen7.c - Fix potential division by zero modulo in run.c
- Add array bounds guards for string operations in guided.c, msc_tcl.c, and structs.c - Fix sizeof(IArg_cont[IArgno]) target buffer in spinlex.c - Fix block scope formatting in spinlex.c - Declare alldone(int) with noreturn attribute and fix comparison logic in main.c - Guard NULL pointers in eligible() in pangen5.c - Clean up redundant pointer checks in flow.c and mesg.c - Remove redundant loop condition in pangen1.c - Add fallthrough annotations, simplify boolean logic, and remove dead assignment in pangen2.c - Remove unreachable code after fatal() in sym.c - Parenthesize assignment and ternary operator expression in tl_mem.c
…rmatting notes - Explicitly cast int/char arguments to match fprintf format specifiers in pangen2.c and pangen3.c - Add NULL pointer checks in claim_has_accept() in pangen7.c - Guard pointer dereferences in getlocal() and setlocal() in sched.c - Guard NULL pointers when building struct nodes in structs.c - Guard NULL pointers in dupnode() and isequal() in tl_cache.c - Cast memory size arguments to long for printf formatting in tl_cache.c and tl_main.c
…n.c, and condition in run.c - Make NextOpt static 2D array indexed by Level in dstep.c to avoid storing dangling stack pointer - Replace debug assertions with explicit runtime bounds checks for command-line arguments in main.c to prevent buffer overflows from tainted argv data - Remove redundant e->n check in run.c
…and enable -O3 in build flags
…, emstrdup helper, memset zero loop - emalloc() now routes all allocations ≤256 bytes through a 256KB bump-pointer arena, eliminating per-object malloc() overhead and improving cache locality of small objects - emstrdup() replaces scattered emalloc(strlen)+strcpy patterns with a single memcpy call - Symbol and Ordered nodes now allocated from dedicated 512-slot chunk pools in sym.c, reducing malloc calls during symbol table construction by 512x - disambiguate() precomputes combined strlen before emalloc to avoid double traversal - tl_mem.c: replaced manual per-word zeroing loop with a single SIMD-eligible memset call
…arks, and verifier tuning
…tream buffering for C code generator
…col Promela model with atomicity invariants
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This branch (
dev) combines all recent fixes and updates for the Spin codebase:README.md.main.cmesg.cpangen2.c,pangen3.c, andrun.c1UL << j) inpangen6.crun.cguided.c,msc_tcl.c, andstructs.cspinlex.c(sizeof(IArg_cont[IArgno]))pangen5.c,flow.c,mesg.c,pangen1.c, andsym.cpangen2.cpangen2.c,pangen3.c,tl_cache.c, andtl_main.cpangen7.c,sched.c,structs.c, andtl_cache.cVerification
make clean && make) completed with 0 errors and 0 compiler warnings.