compiler: for package-scope "a = b; b = x" just set "a = x"
This avoids requiring an init function to initialize the variable.
This can only be done if x is a static initializer.
The go1.15rc1 runtime package relies on this optimization.
The package has a variable "var maxSearchAddr = maxOffAddr".
The maxSearchAddr variable is used by code that runs before package
initialization is complete.
Reviewed-by: Cherry Zhang <firstname.lastname@example.org>
1 file changed