Commit Graph
2 Commits
Author SHA1 Message Date
Jash c4e484dc77 fix: reject monitor link expressions with tokens left over after parsing refs #5991 2026-11-15 23:12:55 +05:30
Nic BoetandClaude Opus 5.5 2f7ace2c2f fix: keep the linked-monitor expression's own copy of its string
MonitorLinkExpression kept a string_view of the string it was built
from, Monitor::linked_monitors_string, and the tokens parse() builds are
views into it. Monitor::Reload() calls Load(), which reassigns that
string without re-parsing the expression, so once the new value no
longer fits the old buffer every token points into freed memory. They
are read by the Debug(1, ...) calls in MonitorLinkExpression::visit(),
which runs on every analysed frame of a monitor with LinkedMonitors set
when its debug level is 1 or more.

Copy the string into the expression and point the views at the copy.

fixes #5271

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-12 15:57:16 -05:00