You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Conditionally compile contracts instead of deciding at run-time
The initial implementation of contracts, despite requiring a
compiler flag to enable runtime checking of contracts, still
compiled contracts into function definitions, even when
the compiler flag was disabled. This meant that contracts
could not be safely added to functions without breaking
optimisations, or even without potentially changing
the behaviour of the function.
This change guards macro expansion of the built-in contract macros
with the contract-checks compiler flag. Additionally, it removes
the contract_checks compiler intrinsic that was used to determine
whether contract checks should be executed at runtime. Now,
when contracts checks are compiled into the body of a function,
they will always be executed.
0 commit comments