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
effects: fix effects of atomic pointer operations (#57806)
The `_unsetindex!(::GenericMemoryRef)` function was being concretely
evaluated (meaning the code was actually being run during inference) by
the `REPLInterpreter`.
The root cause is that the Base compiler system forgot to mark
`atomic_pointerset` as "effect-free".
This is simply a bug in the effect system. It didn't cause problems
during normal Base compilation because `atomic_pointerset` was correctly
marked as "consistent" (concrete evaluation requires both "consistent"
and "effect-free"). However, this was still a pretty risky situation.
The reason this only caused problems with REPL completion is that the
`REPLInterpreter` intentionally ignores the "consistent" requirement
under certain conditions to achieve better completion accuracy. This is
usually fine, but it relies on "effect-free" being correctly marked. So,
when there's a critical bug like this in the effect system, these kinds
of dangerous issues can occur.
As discussed with Jameson earlier, the effects of atomic pointer
operations are not precisely defined.
This commit includes the minimal changes necessary to fix#57780, but a more extensive audit is planned for later.
- closes#57780
---------
Co-authored-by: Jameson Nash <[email protected]>
0 commit comments