Lucio De Re [Fri, 26 Aug 2011 21:42:59 +0000 (17:42 -0400)]
8g: fix build on Plan 9
8g/cgen.c:
8g/gobj.c
. dropped unnecessary assignments;
8g/gg.h
. added varargckk pragmas;
8g/ggen.c
. dropped duplicate assignment;
8g/gsubr.c
. adjusted format in print statement;
. dropped unnecessary assignment;
. replaced GCC's _builtin_return_address(0) with Plan 9's
getcallerpc(&n) which is defined as a macro in <u.h>;
8g/list.c
. adjusted format in snprint statement;
8g/opt.h
. added varargck pragma (Adr*) that is specific for the invoking
modules;
8g/peep.c
. dropped unnecessary incrementation;
Russ Cox [Fri, 26 Aug 2011 21:19:52 +0000 (17:19 -0400)]
mime: fix build
The fix is to add ' ' after ';' so that we match
what we used to generate.
Packages like http look for the string with
the space in it, and I don't see a reason to
be so terse.
Joel Sing [Fri, 26 Aug 2011 19:38:02 +0000 (15:38 -0400)]
net: disable "tcp" test on openbsd
Doing a socket/listen on an unspecified address with an unspecified
address family is likely to result in an AF_INET6 socket on an IPv6
capable system, which under OpenBSD means IPv6 only - not IPv4 *and*
IPv6. In this case trying to connect to this socket from an IPv4
loopback address is not going to end well.
Brad Fitzpatrick [Fri, 26 Aug 2011 08:27:33 +0000 (12:27 +0400)]
json: fix decode bug with struct tag names with ,opts being ignored
When the encoder was updated to respect the ",omitempty"
struct tag options, the decoder half was never updated to know
about the new struct tag format. (the format is now an optional
name, followed by zero or more ",option" strings)
This only affected people who used ",omitempty" along with
a field name. In that case, the serialized JSON wouldn't
decode to the original value.
Benny Siegert [Fri, 26 Aug 2011 01:36:52 +0000 (11:36 +1000)]
image/tiff: decoder optimization.
Write to image.*.Pix directly in the case of RGB, RGBA and NRGBA
images. For the latter two, the file format matches the memory layout
so a simple copy can be used.
Robert Griesemer [Fri, 26 Aug 2011 00:46:43 +0000 (17:46 -0700)]
godoc: added systematic throttling to indexing goroutine
- implemented stand-alone Throttle mechanism
- added new flag -index_throttle to godoc
- index throttling enables index creation when running
godoc on app engine as it keeps godoc responsive
Mike Samuel [Thu, 25 Aug 2011 01:24:43 +0000 (11:24 +1000)]
exp/template/html: Reworked escapeText to recognize attr boundaries.
The following testcases now pass:
`<a href=x` tests that we do not error on partial unquoted attrs.
`<a href=x ` tests that spaces do end unquoted attrs on spaces.
`<a href=''` tests that we recognize the end of single quoted attrs.
`<a href=""` tests that we recognize the end of double quoted attrs.
Volker Dobler [Wed, 24 Aug 2011 17:59:52 +0000 (13:59 -0400)]
math: fix Pow10 loop
Pow10 failed for MinInt32 (endless loop until out of
memory). Fix by returning 0 and +Inf for all arguments
where the result is not representable in a float64.
Fixes #2159.
Brad Fitzpatrick [Wed, 24 Aug 2011 12:09:49 +0000 (16:09 +0400)]
http: adjust test threshold for larger suse buffers
My theory is that suse has larger TCP buffer sizes
by default. I now check over 100MB, rather than over 2MB.
100MB is ~halfway between the 1MB limit and the 200MB
request that's attempted.
Russ Cox [Wed, 24 Aug 2011 02:50:08 +0000 (22:50 -0400)]
reflect: add Value.Bytes, Value.SetBytes methods
This allows code that wants to handle
[]byte separately to get at the actual slice
instead of just at individual bytes.
It seems to come up often enough.
Russ Cox [Wed, 24 Aug 2011 02:39:39 +0000 (22:39 -0400)]
gobuilder: increase log limit
It's a balance between fetching too much
and falling far enough behind that you can't
catch up. We missed 20 commits in a row
when the builders were down for a few days.
This gives us a little more leeway.
Russ Cox [Wed, 24 Aug 2011 02:39:25 +0000 (22:39 -0400)]
http: delete error kludge
The kludge is targeted at broken web browsers
like Chrome and IE, but it gets in the way of
sending 400 or 500-series error results with
formatted bodies in response to AJAX requests
made by pages executing in those browsers.
Now the AJAX cases will work and Chrome
and IE will be as broken with Go servers as
they are with all the other servers.
Robert Griesemer [Tue, 23 Aug 2011 21:17:18 +0000 (14:17 -0700)]
go/ast: adjustments to filter function
CL 4938041 made some incorrect changes to the filter
function which caused a different doc/codelab/wiki/index.html
file to be generated.
Added FilterFileExports and FilterPackageExports function.
Same as the existing FileExpors/PackageExports functions
but using shared code. The old functions will be removed
in the next CL.
Julian Phillips [Tue, 23 Aug 2011 21:01:14 +0000 (17:01 -0400)]
gc: fix pc/line table
When a line directive was encountered we would push a new 'z' entry into
the history to indicate the start of new file attributation, and a 'Z'
entry to change line numbering. However we didn't pop the 'z' entry, so
we were actually corrupting the history stack. The most obvious
occurance of this was in the code that build the symbol tables for the
DWARF information - where an internal stack in the linker would overflow
when more than a few line directives were encountered in a single stack
(Issue 1878). So now we pop the 'z' entry when we encounter the end of
the file that the directive was in, which maintains the history stack
integrity.
Also, although new 'z' entries for new files had relative paths
expanded, the same was not done for line directives. Now we do it for
line directives also - so that the now correct DWARF information has the
full path available.
Robert Griesemer [Tue, 23 Aug 2011 16:22:41 +0000 (09:22 -0700)]
go/parser: fix type switch scoping
Introduce extra scope for the variable declared by a
TypeSwitchGuard so that it doesn't conflict with vars
declared by the initial SimpleStmt of a type switch.
This is a replacement for CL 4896053 which caused
a build breakage.
Also:
- explicitly detect type switches (as opposed to detecting
expression switches and then do extra testing for type switches)
- fix all outstanding TODOs in parser.go
- ran all tests
Brad Fitzpatrick [Tue, 23 Aug 2011 08:17:21 +0000 (12:17 +0400)]
http: add MaxBytesReader to limit request body size
This adds http.MaxBytesReader, similar to io.LimitReader,
but specific to http, and for preventing a class of DoS
attacks.
This also makes the 10MB ParseForm limit optional (if
not already set by a MaxBytesReader), documents it,
and also adds "PUT" as a valid verb for parsing forms
in the request body.
Improves issue 2093 (DoS protection)
Fixes #2165 (PUT form parsing)
Russ Cox [Tue, 23 Aug 2011 03:26:39 +0000 (23:26 -0400)]
runtime: simplify stack traces
Make the stack traces more readable for new
Go programmers while preserving their utility for old hands.
- Change status number [4] to string.
- Elide frames in runtime package (internal details).
- Swap file:line and arguments.
- Drop 'created by' for main goroutine.
- Show goroutines in order of allocation:
implies main goroutine first if nothing else.
There is no option to get the extra frames back.
Uncomment 'return 1' at the bottom of symtab.c.
$ 6.out
throw: all goroutines are asleep - deadlock!
goroutine 2 [select (no cases)]:
main.sel()
/Users/rsc/g/go/src/pkg/runtime/x.go:11 +0x18
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:19 +0x23
goroutine 3 [chan receive]:
main.recv(0xf8400010a0, 0x0)
/Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:20 +0x50
goroutine 4 [chan receive (nil chan)]:
main.recv(0x0, 0x0)
/Users/rsc/g/go/src/pkg/runtime/x.go:15 +0x2e
created by main.main
/Users/rsc/g/go/src/pkg/runtime/x.go:21 +0x66
$
$ 6.out index
panic: runtime error: index out of range
Lucio De Re [Tue, 23 Aug 2011 03:24:38 +0000 (23:24 -0400)]
ld: handle Plan 9 ar format
The Go version has 64 character long section names; originally,
in Plan 9, the limit was 16. To provide compatibility, this
change allows the input length to be either the target length
or the earlier option. The section name is extended with spaces
where required.
This has been tested to work without regressions in the
Go environment, testing the older alternative has not been
possible yet.
Marcel van Lohuizen [Mon, 22 Aug 2011 10:11:29 +0000 (12:11 +0200)]
exp/norm: a few minor fixes to support the implementation of norm.
maketables.go/tables.go
- Properly set combinesForward flag for JamoL and JamoV.
- Fixed Printf bug.
composition.go
- Make insertString use the same control flow as insert.
- Better Hangul and non-Hangul mixing.
forminfo.go
- Fixed bug in compBoundaryBefore that affected a few esoteric cases.
- Buffer overflow now tested in normalize_test.go (other CL).
Rob Pike [Sat, 20 Aug 2011 23:46:19 +0000 (09:46 +1000)]
effective_go: convert to use tmpltohtml.
Also update the big example to the new template system.
There are a number of other examples that should be
extracted; this CL serves as an introduction to the
approach.
Robert Griesemer [Sat, 20 Aug 2011 19:30:26 +0000 (12:30 -0700)]
godoc: remove uses of container/vector
In the process, rewrite index.go to use slices instead
of vectors, rewrite for-loops into range loops, and
generally simplify code (this code was written before
the launch of go and showed its age).
Also, fix a wrong import in appinit.go.
No significant performance changes (improvements);
most of time is spent elsewhere (measured on an stand-
alone MacBook Pro with SSD disk, running standard
godoc settings: godoc -v -http=:7777 -index).