1. 28 Sep, 2015 3 commits
    • Andrew Gerrand's avatar
      text/template, html/template: add block keyword and permit template redefinition · 12dfc3be
      Andrew Gerrand authored
      This change adds a new "block" keyword that permits the definition
      of templates inline inside existing templates, and loosens the
      restriction on template redefinition. Templates may now be redefined,
      but in the html/template package they may only be redefined before
      the template is executed (and therefore escaped).
      
      The intention is that such inline templates can be redefined by
      subsequent template definitions, permitting a kind of template
      "inheritance" or "overlay". (See the example for details.)
      
      Fixes #3812
      
      Change-Id: I733cb5332c1c201c235f759cc64333462e70dc27
      Reviewed-on: https://go-review.googlesource.com/14005Reviewed-by: default avatarRob Pike <r@golang.org>
      12dfc3be
    • Ian Lance Taylor's avatar
      cmd/cgo: only declare real function in gccgo exported header file · 09c6d13a
      Ian Lance Taylor authored
      When exporting a function using gccgo, we generate two functions: a Go
      function with a leading Cgoexp_ prefix, and a C function that calls the
      Go function.  The Go function has a name that can not be represented in
      C, so the C code needs a declaration with an __asm__ qualifier giving
      the name of the Go function.
      
      Before this CL we put that declaration in the exported header file.
      Because code would sometimes #include "_cgo_export.h", we added a macro
      definition for the C function giving it the name of the declaration.  We
      then added a macro undefine in the actual C code, so that we could
      declare the C function we wanted.
      
      This rounadabout process worked OK until we started exporting the header
      file for use with -buildmode=c-archive and c-shared.  Doing that caused
      the code to see the define and thus call the Go function rather than the
      C function.  That often works fine, but the C function calls
      _cgo_wait_runtime_init_done before calling the Go function, and that
      sometimes matters.  This didn't show up in tests because we don't test
      using gccgo.  That is something we should fix, but not now.
      
      Fix that by simplifying the code to declare the C function in the header
      file as one would expect, and move the __asm__ declaration to the C
      code.
      
      Change-Id: I33547e028152ff98e332630994b4f33285feec32
      Reviewed-on: https://go-review.googlesource.com/15043Reviewed-by: default avatarMinux Ma <minux@golang.org>
      09c6d13a
    • Joel Sing's avatar
      tests/fixedbugs: make test for issue11656 run known instruction · 82a9d90e
      Joel Sing authored
      As detailed in #11910, the current implementation attempts to execute an area
      of memory with unknown content. If the memory is executable, the result is
      unpredictable - instead, make the test deterministic by attempting to execute
      an instruction that is known to trigger a trap on the given architecture.
      
      The new implementation is written by iant@ and provided via #11910.
      
      Update issue #11910
      
      Change-Id: Ia698c36e0dd98a9d9d16a701f60f6748c6faf896
      Reviewed-on: https://go-review.googlesource.com/15058
      Run-TryBot: Joel Sing <jsing@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      82a9d90e
  2. 27 Sep, 2015 2 commits
  3. 25 Sep, 2015 8 commits
  4. 24 Sep, 2015 8 commits
  5. 23 Sep, 2015 17 commits
  6. 22 Sep, 2015 2 commits