use a shared pointer for var_opt in the parser
UBSan finds that Bison-generated code does some undefined behaviour by reading from an uninitialised bool variable (you can see this with the example tests/mixed-aliases.m). We have no ability to initialise this variable ($$) at declaration time, so we avoid this by wrapping the bool in a std::shared_ptr. This means we now heap-allocate this value unnecessarily, but this isn't performance sensitive code, so seems acceptable.
parent
569dcf45
Please register or sign in to comment