NativeJIT icon indicating copy to clipboard operation
NativeJIT copied to clipboard

Static initialization order fiasco

Open danluu opened this issue 8 years ago • 1 comments

Register.h

    // TODO: Need to avoid "static initialization order fiasco" for register definitions.
    // See http://www.parashift.com/c++-faq/static-init-order.html.
    // Plan is to use constexpr when VS2013 becomes available to Bing build.

Constexpr is available for us.

danluu avatar Apr 29 '16 01:04 danluu

Below the comment, each extern line runs a constructor to define a register (like al). Constructors of random top-level things aren't always run first.

danluu avatar Apr 29 '16 01:04 danluu