This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[Bug go/66431] [go] Unexpected function return value after it is redefined in closure


https://gcc.gnu.org/bugzilla/show_bug.cgi?id=66431

Ian Lance Taylor <ian at airs dot com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|UNCONFIRMED                 |RESOLVED
         Resolution|---                         |INVALID

--- Comment #2 from Ian Lance Taylor <ian at airs dot com> ---
This is not a bug in either toolchain.  The Go language does not fully specify
the order of evaluation.  In the line
    return value, closure()
it is not specified whether value is read before after closure is called.  The
two toolchains are making different choices.  Both are correct.  The program is
indeterminate.

This is already explained at the code.google.com link that you attached.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]