Skip to content

Fix dangling pointers in preprocessor macro handling#20

Merged
shivaduke28 merged 5 commits into
mainfrom
fix/preprocessor-macro-dangling-pointers
Apr 5, 2026
Merged

Fix dangling pointers in preprocessor macro handling#20
shivaduke28 merged 5 commits into
mainfrom
fix/preprocessor-macro-dangling-pointers

Conversation

@shivaduke28
Copy link
Copy Markdown
Owner

Summary

  • Reserve std::vector capacity before the loop in SLGlobalSession.mm to prevent push_back reallocation from invalidating c_str() pointers in PreprocessorMacroDesc entries
  • Apply the same fix to search path construction which had the same bug
  • Add preprocessor macro tests (single macro, multiple macros, macro with value)

Closes #19

Test plan

  • testMultiplePreprocessorMacros — 3 macros defined simultaneously (issue reproduction case)
  • testPreprocessorMacroAffectsCompilation#ifdef branching verification
  • testPreprocessorMacroWithValue — macro value expansion with array size

🤖 Generated with Claude Code

shivaduke28 and others added 5 commits April 5, 2026 21:19
Reserve vector capacity before the loop to prevent reallocation from
invalidating c_str() pointers stored in PreprocessorMacroDesc entries.
Also fix the same issue in search path construction. Add preprocessor
macro tests.

Closes #19

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The macos-15 runner no longer includes iOS Simulator runtimes with
Xcode 16.2, causing destination lookup failures.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The XCFramework only includes iOS libraries, so macOS destination
cannot be used. Install the iOS platform to make the simulator
available on macos-15 runners.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
The macos-15 runner no longer includes iOS Simulator runtimes for
Xcode 16.2. Use Xcode 16.4 which has pre-installed runtimes available.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@shivaduke28 shivaduke28 merged commit da3078e into main Apr 5, 2026
1 check passed
@shivaduke28 shivaduke28 deleted the fix/preprocessor-macro-dangling-pointers branch April 5, 2026 12:32
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

preprocessorMacros with multiple entries causes dangling pointers

1 participant