Commit 9d186392 authored by Matthew Fernandez's avatar Matthew Fernandez
Browse files

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
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment