Join GitHub today
GitHub is home to over 40 million developers working together to host and review code, manage projects, and build software together.Sign up
cmd/compile: possible oversight with internal/gc.disableExport #31049
I was just studying closure.go and noticed that we invoke disableExport(sym) for closures created.
However, in the body of disableExport we see that we invoke
This change is from CL 108216
I believe it should be
otherwise if you add debugs you'll see that we encounter closure symbols such as
Thanks @odeke-em , but I believe it's correct as-is. The OnExportList flag is used by exportsym to avoid adding a symbol to exportlist if it's already been added:
The way disableExport works is that it sets OnExportList before exportsym is called, so that exportsym thinks the symbol has already been added to exportlist and avoids adding it again.
Thanks for the reply @mdempsky!
Perhaps let's rename that helper function to
Perhaps let's think of a different marking naming, because