r244982 - in /trunk/gcc/go/gofrontend: MERGE ex...

ian@gcc.gnu.org ian@gcc.gnu.org
Fri Jan 27 15:08:00 GMT 2017


Author: ian
Date: Fri Jan 27 15:08:23 2017
New Revision: 244982

URL: https://gcc.gnu.org/viewcvs?rev=244982&root=gcc&view=rev
Log:
    compiler: let initializers hold addresses of fields
    
    The runtime.dbgvars initializer looks like
    
    var dbgvars = []dbgVar{
            {"allocfreetrace", &debug.allocfreetrace},
    }
    
    Because the field address was not recognized as valid for a static
    initializer, the variable was initialized at runtime.  Normally that
    would be fine, but for the runtime package it meant that dbgvars was
    not initialized when it was read by parsedebugvars.  That meant that
    the GODEBUG environment variable did nothing.
    
    Fixing that revealed that the static initializer checks had to be more
    careful about interface types, just like the existing is_constant
    methods.
    
    Reviewed-on: https://go-review.googlesource.com/35891

Modified:
    trunk/gcc/go/gofrontend/MERGE
    trunk/gcc/go/gofrontend/expressions.cc
    trunk/gcc/go/gofrontend/expressions.h



More information about the Gcc-cvs mailing list