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
The //go:nowritebarrier and //go:nowritebarrierrec annotations in the runtime are not being checked in SSA mode.
For example, add sched.gfree = sched.gfree to any go:nowritebarrier function and compile the runtime. It should fail, but doesn't. Recompile with -gcflags -ssa=0 and it will correctly fail with "write barrier prohibited".
I guess there's some subsequent logic in the legacy compiler that removes the write barrier if it notices that the pointer being written is to the same object as the pointer that is already there. Might be nice if we pushed that logic up to before the SSA cutoff so it can be shared.
The
//go:nowritebarrier
and//go:nowritebarrierrec
annotations in the runtime are not being checked in SSA mode.For example, add
sched.gfree = sched.gfree
to anygo:nowritebarrier
function and compile the runtime. It should fail, but doesn't. Recompile with -gcflags -ssa=0 and it will correctly fail with "write barrier prohibited"./cc @randall77 @dr2chase
The text was updated successfully, but these errors were encountered: