3 Commits

Author SHA1 Message Date
yusufcanislek 981dbb8eda fix: address PR #74 review findings (P1 stackMemory, P2 private API, P2 wide-load diagnostic)
- CustomPasses.hpp: move stackMemory declaration inside the per-function
  loop so each function gets its own alloca with correct size and
  ownership. Previously dormant (single-function modules) but wrong.

- verify_plan.py: rename _build_plan -> build_plan, _run_plan -> run_plan.
  These are used cross-module by run_review.py and should be public API.

- run_review.py: update callers to use the renamed public functions.

- FileReader.hpp: add fprintf(stderr) diagnostic before silent return 0
  on byteSize > 8 (wide SSE/AVX loads). Uses fprintf instead of
  printvalue2 to avoid cross-layer dependency (memory -> core).
2026-03-26 07:45:10 +03:00
yusufcanislek 8fdf1da8ac fix: P0 correctness bugs in PathSolver, FileReader, GEPTracker
PathSolver.ipp:
- Remove 'static' from try_simplify lambda that captured [&] references
  from first invocation only (use-after-free on subsequent calls)
- Guard cast<Instruction>(condition) with dyn_cast — createICMPFolder
  can return a ConstantInt, crashing the assert in cast<>
- Add pv.empty() handler that emits CreateUnreachable() instead of
  leaving the basic block unterminated (LLVM verifier failure)
- Return PATH_multi_solved (not PATH_unsolved) after successful
  SwitchInst emission for >2 targets

FileReader.hpp:
- Add byteSize > sizeof(uint64_t) guard in both readMemory_impl
  variants to prevent stack buffer overflow on SSE/AVX-width reads

GEPTracker.ipp:
- Restructure retrieveCombinedValue to check v.isRef before accessing
  v.memoryAddress in the union — reading the inactive union member
  is undefined behavior
2026-03-19 19:18:55 +03:00
yusufcanislek 1ed00cc67e Refactor: reorganize lifter/ into subdirectories with PascalCase naming
Directory structure:
  lifter/core/       - LifterClass, pipeline, drivers, application, utils
  lifter/semantics/  - Semantics*.ipp, OperandUtils.ipp, opcodes
  lifter/disasm/     - Disassembler backends, mnemonic/register mappings
  lifter/memory/     - GEPTracker, MemoryPolicy, FileReader
  lifter/analysis/   - PathSolver, CustomPasses
  lifter/test/       - TestInstructions, Tester, test_vectors/

Naming convention standardized to PascalCase:
  fileReader.hpp     -> FileReader.hpp
  lifterClass.hpp    -> LifterClass.hpp
  icedDisassembler*  -> IcedDisassembler*
  utils.h/cpp        -> Utils.h/cpp
  includes.h         -> Includes.h
  pp_macros.hpp      -> PPMacros.hpp
  test_instructions* -> TestInstructions*
  tester.hpp         -> Tester.hpp

Include resolution uses cmake include-directories so no
path prefixes needed in #include directives. All script
paths updated for new test_vectors and opcodes locations.
2026-03-06 18:07:26 +03:00