mirror of
https://git.savannah.gnu.org/git/bison.git
synced 2026-03-11 13:23:04 +00:00
A glr_stack_item has "raw" memory to store either a glr_state or a semantic_option. glr_stack_item::setState stores a state using a copy assignment. However, this is more like a construction: we are starting from "raw" memory, so use the placement new operator instead. While it probably makes no difference when parse.assert is disabled, it does make one when it is: the constructor properly initialize the magic number, the assignment does not. So without these changes, the next commit (which stores genuine objects in semantic values) fails tests 712 and 730 because of incorrect magic numbers. * data/skeletons/glr2.cc (glr_stack_item::setState): Build the state, don't just copy it.