Skip to content

grammar: fix modifying_stmt ignoring an explicitly passed victim - #64

Open
linwen wants to merge 1 commit into
anse1:masterfrom
linwen:fix-modifying-stmt-victim
Open

linwen wants to merge 1 commit into
anse1:masterfrom
linwen:fix-modifying-stmt-victim

Conversation

@linwen

@linwen linwen commented Sep 15, 2026

Copy link
Copy Markdown

modifying_stmt skips pick_victim() when a victim is supplied, but never assigns the argument to the member of the same name, leaving it uninitialized. Derived statements then dereference it (e.g. insert_stmt iterating victim->columns()), which is undefined behaviour and crashes in practice.

No in-tree caller passes a victim yet, so existing behaviour is unchanged: null still means "pick a random table".

modifying_stmt skips pick_victim() when a victim is supplied, but never
assigns the argument to the member of the same name, leaving it
uninitialized.  Derived statements then dereference it (e.g.
insert_stmt iterating victim->columns()), which is undefined behaviour
and crashes in practice.

No in-tree caller passes a victim yet, so existing behaviour is
unchanged: null still means "pick a random table".
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