Skip to content

[Sim] guard malformed expression parsing#11460

Open
Harmenszoon wants to merge 2 commits into
simulationcraft:midnightfrom
Harmenszoon:codex/fix-expression-parse-guards
Open

[Sim] guard malformed expression parsing#11460
Harmenszoon wants to merge 2 commits into
simulationcraft:midnightfrom
Harmenszoon:codex/fix-expression-parse-guards

Conversation

@Harmenszoon
Copy link
Copy Markdown
Contributor

Summary

  • Guard pet.any.active expression parsing so malformed pet.any no longer reads past the split-vector bounds.
  • Guard actors.<name>.<expr> expression parsing against missing actors by checking the looked-up actor pointer instead of the sim target.

Details

Both changes route malformed expressions through the normal invalid-expression initialization error path instead of undefined behavior or an access violation.

pet.any.active.<trailing> is also no longer silently accepted as pet.any.active; the valid generated form remains pet.any.active.

Validation

  • Rebuilt build-codex with VS2022 DevCmd + CMake.
  • simc hunter=test spec=beast_mastery level=90 race=orc role=attack position=ranged_back load_default_gear=1 load_default_talents=1 iterations=1 output=NUL actions=variable,name=bad,value=pet.any now exits 30 with a normal initialization error.
  • Same command with value=pet.any.active exits 0.
  • Same command with value=actors.nope.health.pct now exits 30 with a normal initialization error instead of access violation.
  • Same command with value=actors.test.health.pct exits 0.
  • simc display_build=2 output=NUL exits 0.
  • simc profiles/CI.simc iterations=1 cleanup_threads=1 output=NUL exits 0 with existing baseline profile/data warnings.
  • git diff --check origin/midnight...HEAD passed.

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.

1 participant