FAQ

On 2012/09/17 21:16:19, rsc wrote:
Looks good, and ouch, but can you add a test please? I don't want this creeping
back in later.
I've yet to find a case where the double evaluation actually changes the
state of the program, so that I can test it. Only symptom I've found so
far is calling the idempotent convT2[EI] functions twice.

I'll take a closer look at this later today and see if I can find a
proper testable case. If anyone got any ideas, please chime in.

http://codereview.appspot.com/6498133/

Search Discussions

  • Russ Cox at Sep 18, 2012 at 2:59 pm
    LGTM

    I see. It's not fixing a bug, because the side effects have already
    been removed. It is just removing things like redundant map lookups.
  • Daniel Morsing at Sep 18, 2012 at 6:15 pm
    *** Submitted as
    http://code.google.com/p/go/source/detail?r=ac57e49ab58b ***

    cmd/gc: fix double evaluation in interface comparison

    During interface compare, the operands will be evaluated twice. The
    operands might include function calls for conversion, so make them cheap
    before comparing them.

    R=rsc
    CC=golang-dev
    http://codereview.appspot.com/6498133


    http://codereview.appspot.com/6498133/

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
groupgolang-dev @
categoriesgo
postedSep 18, '12 at 6:22a
activeSep 18, '12 at 6:15p
posts3
users2
websitegolang.org

2 users in discussion

Daniel Morsing: 2 posts Russ Cox: 1 post

People

Translate

site design / logo © 2022 Grokbase