Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix detect test functions #52

Open
wants to merge 5 commits into
base: master
Choose a base branch
from

Commits on Jan 17, 2023

  1. This fixes the detection of test-functions (makes it more robust).

    The strides are in general not constant between each ctest struct stored in memory, so we need to search specifically for the magic number.
    
    With TinyC https://repo.or.cz/tinycc.git on linux, the stride is mostly 14 ints between each entry, but sometimes 16 and 18. On other platforms it is always 14 ints.
    It now searches 8 ints beyond the ctest struct size, which is double of extra stride sometimes observed with TinyC. Both the current and this search is UB as it accesses memory outside the storage,
    but works well in practice on most platforms.
    tylov committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    afb8df9 View commit details
    Browse the repository at this point in the history
  2. Remove spaces.

    tylov committed Jan 17, 2023
    Configuration menu
    Copy the full SHA
    ba90546 View commit details
    Browse the repository at this point in the history

Commits on Jan 18, 2023

  1. Configuration menu
    Copy the full SHA
    3ed78b0 View commit details
    Browse the repository at this point in the history
  2. Reverted to search both before and after the "reference" test to allo…

    …w placing main.c before, after or between test files.
    tylov committed Jan 18, 2023
    Configuration menu
    Copy the full SHA
    466e8a0 View commit details
    Browse the repository at this point in the history

Commits on Jan 20, 2023

  1. I'll leave a last commit which will access only 4 bytes outside the o…

    …uter ctest entry bounds - unless compiler is TINYC on LINUX. The current seach accesses the bytes 56-60 beyond the last entry.
    
    On TINYC, it will search up to 44 byte outside if there are gaps between ctest struct entry.
    tylov committed Jan 20, 2023
    Configuration menu
    Copy the full SHA
    2035400 View commit details
    Browse the repository at this point in the history