1
0
mirror of https://github.com/golang/go synced 2024-10-04 03:21:22 -06:00
Commit Graph

5022 Commits

Author SHA1 Message Date
Russ Cox
68b4255a96 runtime: ,s/[a-zA-Z0-9_]+/runtime·&/g, almost
Prefix all external symbols in runtime by runtime·,
to avoid conflicts with possible symbols of the same
name in linked-in C libraries.  The obvious conflicts
are printf, malloc, and free, but hide everything to
avoid future pain.

The symbols left alone are:

	** known to cgo **
	_cgo_free
	_cgo_malloc
	libcgo_thread_start
	initcgo
	ncgocall

	** known to linker **
	_rt0_$GOARCH
	_rt0_$GOARCH_$GOOS
	text
	etext
	data
	end
	pclntab
	epclntab
	symtab
	esymtab

	** known to C compiler **
	_divv
	_modv
	_div64by32
	etc (arch specific)

Tested on darwin/386, darwin/amd64, linux/386, linux/amd64.

Built (but not tested) for freebsd/386, freebsd/amd64, linux/arm, windows/386.

R=r, PeterGo
CC=golang-dev
https://golang.org/cl/2899041
2010-11-04 14:00:19 -04:00
Ian Lance Taylor
d2d650bdc9 Use future official DWARF language code for Go.
http://dwarfstd.org/ShowIssue.php?issue=101014.1&type=open

Informally accepted for future DWARF 5.

R=lvd
CC=golang-dev, rsc
https://golang.org/cl/2881042
2010-11-04 08:45:25 -07:00
Chris Jones
25b1e83262 net: fix LookupSRV
R=rsc, chris
CC=golang-dev
https://golang.org/cl/2420041
2010-11-04 10:30:39 -04:00
Ken Thompson
9c6df3ca13 add hardware floating point.
currently, softfloat does not work and
there are some unsigned-to-float conversion errors.

R=rsc
CC=golang-dev
https://golang.org/cl/2886041
2010-11-03 17:31:07 -07:00
Rob Pike
0aa9d84b56 units: fix compilation
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/2865041
2010-11-03 12:20:37 -07:00
Adam Langley
02939dec80 crypto: switch block ciphers to detination first.
Previously all the functions took two arguments: src, dst. This is the
reverse of the usual Go style and worth changing sooner rather than
later.

Unfortunately, this is a change that the type system doesn't help
with. However, it's not a subtle change: any unittest worth the name
should catch this.

R=rsc, r
CC=golang-dev
https://golang.org/cl/2751042
2010-11-03 10:43:43 -04:00
Adam Langley
b5135b34c9 crypto: add cast5
CAST5 is the default OpenPGP cipher.

(This won't make Rob any happier about the size of crypto/, of course.)

It already has dst, src in that order but it doesn't have any users yet so I figure it's better than changing it later.

R=rsc, gri, r
CC=golang-dev
https://golang.org/cl/2762042
2010-11-03 10:39:15 -04:00
Robert Griesemer
417e22b584 sync: fix typo in documentation
R=rsc, adg
CC=golang-dev
https://golang.org/cl/2841041
2010-11-02 16:01:07 -07:00
Kai Backman
95b40f6ca1 Fix a deadlock bug in the rpc client. The panic will trigger
regularly when client connections are flaky (probably another
issue).

(credits to jussi@tinkercad.com for finding the issue)

R=rsc, r
CC=golang-dev, jussi
https://golang.org/cl/2831042
2010-11-02 14:04:56 -07:00
Rob Pike
59315fbfb5 netchan: fix locking bug.
There's no need to hold the client mutex when calling encode, since encode itself
uses a mutex to make the writes atomic.  However, we need to keep
the messages ordered, so add a mutex for that purpose alone.
Fixes #1244.

R=rsc
CC=golang-dev
https://golang.org/cl/2833041
2010-11-02 10:58:27 -07:00
Robert Griesemer
396228a652 go/scanner: removed scanner/internal-only uses of token.Position
First step towards a more light-weight implementation of token.Position:
- only use token.Position for reporting token and error position
- use offsets only for scanner control
- no interface changes yet

R=rsc
CC=golang-dev
https://golang.org/cl/2825041
2010-11-02 10:38:07 -07:00
Alex Brainman
8f8f625cb1 8l: pe generation fixes
Restore ability to have different file and
section alignment in generated pe file.

Stop generating .bss pe section, it is
part of .data now.

Some code refactoring.

R=rsc, vcc
CC=golang-dev
https://golang.org/cl/2731041
2010-11-02 10:56:56 +11:00
Robert Griesemer
ce98044523 fix build
R=rsc
CC=golang-dev
https://golang.org/cl/2820041
2010-11-01 15:25:39 -07:00
Brad Fitzpatrick
b0afb931a8 Use strings.Contains in src/cmd/...
R=r
CC=golang-dev, r2, rsc
https://golang.org/cl/2819041
2010-11-01 15:21:35 -07:00
Robert Griesemer
7996924c89 go/printer: do not remove parens around composite literals starting with a type name in control clauses
(even when they are nested inside an expression).

Fixes #1243.

R=rsc
CC=golang-dev
https://golang.org/cl/2817041
2010-11-01 15:08:03 -07:00
Robert Griesemer
9384fdc96a go/ast: add Inspect function for easy AST inspection w/o a visitor
R=rsc
CC=golang-dev
https://golang.org/cl/2770044
2010-11-01 15:06:34 -07:00
Wei Guangjing
035696c59a debug/pe, cgo: add windows support
R=rsc, mattn
CC=golang-dev
https://golang.org/cl/1976045
2010-11-01 17:52:26 -04:00
Brad Fitzpatrick
e198a5086a strings: Contains
Tiny helper to avoid strings.Index(s, sub) != -1

R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2265044
2010-11-01 14:32:48 -07:00
Rob Pike
e8436689ad gotest: if the benchmark list is empty, print it in a way that
gofmt will leave alone.

R=rsc, bradfitz, bradfitzpatrick
CC=golang-dev
https://golang.org/cl/2816041
2010-11-01 14:23:07 -07:00
Albert Strasheim
6442f38a91 syscall: SIO constants for Linux
R=rsc
CC=golang-dev
https://golang.org/cl/2303043
2010-11-01 16:42:33 -04:00
Roger Peppe
270bad3939 testing: add Benchmark to allow benchmarks to be run without gotest.
R=rsc
CC=golang-dev
https://golang.org/cl/2506042
2010-11-01 16:15:17 -04:00
Michael Hoisie
7b4eed7d66 http server: don't send trailing '0' for chunked encoding when responding with 304 NotModified
R=rsc, adg
CC=golang-dev
https://golang.org/cl/2723041
2010-11-01 16:15:03 -04:00
Russ Cox
276003adb1 build: fiddle with make variables
Fixes #1234.

R=r, r2
CC=golang-dev
https://golang.org/cl/2735043
2010-11-01 16:14:58 -04:00
Anthony Martin
51b15d68aa libutf: update to Unicode 5.2.0 to match pkg/unicode
R=rsc, r, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2753045
2010-11-01 16:14:48 -04:00
Evan Shaw
884dceca1f 6a/6l: fix MOVOU encoding
The andproto field was set incorrectly, causing 6a to encode illegal
instructions.

R=rsc
CC=golang-dev
https://golang.org/cl/2781042
2010-11-01 16:14:43 -04:00
Robert Griesemer
68ac0c1d94 go/scanner: don't accept '\x0g' character escape (bug fix)
Added more test cases.

R=rsc
CC=golang-dev
https://golang.org/cl/2804041
2010-11-01 12:50:21 -07:00
Rob Pike
6dc4c58f87 gob: documentation. this time for sure.
if the interface value is nil, it sends no value,

R=rsc, adg
CC=golang-dev
https://golang.org/cl/2801042
2010-10-31 17:48:19 -07:00
Rob Pike
fbfb1d9e72 mkrunetype: install a Makefile and tweak it slightly so it can be built.
R=rsc
CC=golang-dev
https://golang.org/cl/2813041
2010-10-31 17:46:26 -07:00
Rob Pike
41ac2f8a42 gob: update documentation about wire format for interfaces.
R=rsc
CC=golang-dev
https://golang.org/cl/2814041
2010-10-31 15:08:45 -07:00
Rob Pike
7f7cb166c8 gob: several fixes.
1) Be sure to use the eval-time encoder/decoder rather than
the compile-time decoder.  In a few cases the receiver for
the compiling encoder was being pickled incorrectly into a
closure.
(This is the fix for issue 1238).

2) Get the innermost name right when given a pointer to an
unnamed type.

3) Use a count to delineate interface values, making it
possible to ignore values without having a concrete type
to encode into.  This is a protocol change but only for the
new feature, so it shouldn't affect anyone.  The old test
worked because, amazingly, it depended on bug #1.

Fixes #1238.

R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2806041
2010-10-31 13:41:30 -07:00
Alex Brainman
a8c4da996e syscall: fix windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/2713043
2010-10-30 23:55:22 +11:00
Alex Brainman
7812b79627 syscall: fix Stat(path) where path is directory with trailing '/' on windows
Fixes #1220.

R=rsc, r
CC=golang-dev
https://golang.org/cl/2728043
2010-10-30 23:06:49 +11:00
Rob Pike
c490bb6f81 gob: clarify the comments about installing the debug/dumper.
R=rsc
CC=golang-dev
https://golang.org/cl/2789043
2010-10-29 15:52:25 -07:00
Rob Pike
96b9efe8a9 gob: make the debugging (dumping) code work again. Mostly rewrite it, in fact.
It's still not compiled in by default.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2754043
2010-10-29 15:07:56 -07:00
Robert Griesemer
907e998cba go/scanner: added another test case, clarified some code
R=rsc
CC=golang-dev
https://golang.org/cl/2741042
2010-10-29 15:07:04 -07:00
Robert Griesemer
7eb5c9a520 ebnf: use append
R=r, rsc
CC=golang-dev
https://golang.org/cl/2799041
2010-10-28 21:23:24 -07:00
Robert Griesemer
75855a8f5e tabwriter: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2798041
2010-10-28 21:23:04 -07:00
Robert Griesemer
5762cd3755 go/doc: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2792041
2010-10-28 17:26:01 -07:00
Rob Pike
4e9cc085d2 testing: eliminate testing/regexp
Rather than updating the stripped-down regexp implementation embedded
in testing, delete it by passing the one function we need from the package
main file created by gotest.

R=rsc
CC=golang-dev
https://golang.org/cl/2761043
2010-10-28 16:54:24 -07:00
Rob Pike
1f4d54ea01 regexp: eliminate vector in favor of append.
R=rsc
CC=golang-dev
https://golang.org/cl/2795041
2010-10-28 15:54:01 -07:00
Robert Griesemer
fafb116c75 go/printer: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2793041
2010-10-28 15:09:47 -07:00
Robert Griesemer
098e94173a go/typechecker: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2736044
2010-10-28 15:09:21 -07:00
Andrew Gerrand
6062515a93 container/list: document iteration
R=rsc
CC=golang-dev
https://golang.org/cl/2768042
2010-10-29 08:48:16 +11:00
Robert Griesemer
302b0ff942 go/parser: use append
R=rsc
CC=golang-dev
https://golang.org/cl/2720042
2010-10-28 13:36:28 -07:00
Robert Griesemer
12be168b4b godoc: bug fix (bug introduced with revision 3ee58453e961)
(thanks to Chris Dollin for identifying the cause)

Fixes #1237.

R=rsc
CC=golang-dev
https://golang.org/cl/2753043
2010-10-28 08:44:25 -07:00
Russ Cox
69c4e9380b use append
R=gri, r, r2
CC=golang-dev
https://golang.org/cl/2743042
2010-10-27 19:47:23 -07:00
Russ Cox
d8b5d039cd gc: implement append
R=ken2
CC=golang-dev
https://golang.org/cl/2757042
2010-10-27 17:56:32 -07:00
Andrew Gerrand
250ac87368 rpc: expose Server type to allow multiple RPC Server instances
R=r, rsc, msolo, sougou
CC=golang-dev
https://golang.org/cl/2696041
2010-10-28 11:05:56 +11:00
Brad Fitzpatrick
ad7d24ac4b image/png: speed up paletted encoding ~25%
Avoids a lot of redundant bounds checks.

R=nigeltao, rsc
CC=golang-dev
https://golang.org/cl/2678041
2010-10-27 22:48:18 +11:00
Russ Cox
d86ab015f7 use copy
R=gri
CC=golang-dev
https://golang.org/cl/2763041
2010-10-26 21:52:54 -07:00
Russ Cox
e48c0fb562 5g, 6g, 8g: generate code for string index
instead of calling function.

R=ken2
CC=golang-dev
https://golang.org/cl/2762041
2010-10-26 21:11:17 -07:00
Russ Cox
705c0382e8 big: arm assembly, faster software mulWW, divWW
Reduces time spent running crypto/rsa test by 65%.

Fixes #1227.

R=gri, PeterGo
CC=golang-dev
https://golang.org/cl/2743041
2010-10-26 21:10:17 -07:00
Rob Pike
f437d4d356 gob: must register basic types to store them in interfaces.
Fixes #1230.

R=rsc
CC=golang-dev
https://golang.org/cl/2750041
2010-10-26 17:07:39 -07:00
Nigel Tao
3bb036958c gob: package doc fixes.
R=r, r2, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2748041
2010-10-27 10:46:00 +11:00
Russ Cox
82c6f5e3d1 gc, runtime: copy([]byte, string)
R=ken2
CC=golang-dev
https://golang.org/cl/2741041
2010-10-26 08:36:07 -07:00
Russ Cox
8fff9166f6 arm: enable all tests
ARM functionality is now completely working.
(Or if it's not, we'll fix it.)

R=ken2
CC=golang-dev
https://golang.org/cl/2738041
2010-10-25 21:25:13 -07:00
Russ Cox
da26e27c05 debug/gosym: do not run when cross-compiling
R=r
CC=golang-dev
https://golang.org/cl/2737041
2010-10-25 18:00:42 -07:00
Russ Cox
7c2b1597c6 arm: precise float64 software floating point
Adds softfloat64 to generic runtime
(will be discarded by linker when unused)
and adds test for it.  I used the test to check
the software code against amd64 hardware
and then check the software code against
the arm and its simulation of hardware.
The latter should have been a no-op (testing
against itself) but turned up a bug in 5c causing
the vlrt.c routines to miscompile.

These changes make the cmath, math,
and strconv tests pass without any special
accommodations for arm.

R=ken2
CC=golang-dev
https://golang.org/cl/2713042
2010-10-25 17:55:50 -07:00
Robert Griesemer
e351533aab big: delete unnecessary type decls
R=rsc, r
CC=golang-dev
https://golang.org/cl/2732041
2010-10-25 17:45:43 -07:00
Robert Griesemer
19b8fc788c tabwriter: delete unnecessary type declaration
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2733041
2010-10-25 17:45:26 -07:00
Robert Griesemer
c77f090085 go/scanner: delete unnecessary type declarations
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2735041
2010-10-25 17:44:54 -07:00
Rob Pike
5556f733c7 gotest: generate correct gofmt-formatted _testmain.go
Fixes #1225.

R=adg
CC=golang-dev
https://golang.org/cl/2729041
2010-10-25 17:03:25 -07:00
Andrew Gerrand
ec8f8149d2 goinstall: display helpful message when encountering a cgo package.
R=rsc
CC=golang-dev
https://golang.org/cl/2701042
2010-10-26 10:59:30 +11:00
Russ Cox
35f8a3f90e runtime: remove .c generated from .goc during make clean
R=r
CC=golang-dev
https://golang.org/cl/2704042
2010-10-25 16:54:59 -07:00
Russ Cox
079cbddbd8 arm: fix signal handler
R=ken2
CC=golang-dev
https://golang.org/cl/2670042
2010-10-26 01:32:36 +02:00
Russ Cox
b0ad7a4268 5g: complex "regalloc"
R=ken2
CC=golang-dev
https://golang.org/cl/2727041
2010-10-26 01:26:33 +02:00
Russ Cox
41b5fb4761 5c: implement uint32 -> float
There are other missing conversion cases
still but they do not show up in my tests.
This one is needed for vlrt.c's _v2d (int64, uint64 -> float).

Thankfully, VFP has a single instruction to do this.

R=ken2
CC=golang-dev
https://golang.org/cl/2726041
2010-10-25 16:18:16 -07:00
Andrew Gerrand
6e87a0abc9 build: only print "You need to add foo to PATH" when needed
Fixes #1223.

R=bradfitz
CC=golang-dev
https://golang.org/cl/2701041
2010-10-25 16:38:48 +11:00
Andrew Gerrand
32a6613e94 container/list: elide redundant tests and fix comment typo
R=dsymonds
CC=golang-dev
https://golang.org/cl/2700041
2010-10-25 14:50:47 +11:00
Andrew Gerrand
01389b966e container/list: fix Remove bug and use pointer to self as identifier
Remove wasn't nil'ing the *Element.id. This property was exploited
by MoveToFront and MoveToBack internally, so I renamed the existing
Remove to "remove", and created an exported wrapper "Remove" that does
the right thing for the user's sake.

Also, saved an allocation by using *List as the id rather than *byte.

Fixes #1224.

R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/2685042
2010-10-25 14:37:30 +11:00
Fazlul Shahriar
ee065332dd goinstall: don't wrongly error out with "multiple package names"
Fixes #1215.

R=adg, rsc
CC=golang-dev
https://golang.org/cl/2695042
2010-10-25 13:13:00 +11:00
Luuk van Dijk
4228e62259 6l/8l: global and local variables and type info.
R=rsc
CC=golang-dev
https://golang.org/cl/2201044
2010-10-24 23:07:52 +02:00
Rob Pike
c28fa513f5 gob: error cleanup 2
Simplify error handling during the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2652042
2010-10-22 16:07:26 -07:00
Rob Pike
f593b37f23 gobs: error cleanup part 1.
Remove err from the encoderState and decoderState types, so we're
not always copying to and from various copies of the error, and then
use panic/recover to eliminate lots of error checking.

another pass might take a crack at the same thing for the compilation phase.

R=rsc
CC=golang-dev
https://golang.org/cl/2660042
2010-10-22 15:16:34 -07:00
Russ Cox
1dd0319be3 runtime: print unknown types in panic
R=r
CC=golang-dev
https://golang.org/cl/2683041
2010-10-22 17:04:32 -04:00
Russ Cox
e5e9211071 5l, 6l, 8l: introduce sub-symbols
Sub-symbols are laid out inside a larger symbol
but can be addressed directly.

Use to make Mach-O pointer array not a special case.

Will use later to describe ELF sections.

Glimpses of the beginning of ELF loading.

R=ken2
CC=golang-dev
https://golang.org/cl/2623043
2010-10-22 15:27:50 -04:00
Rob Pike
5d9064697b gob: allow exchange of interface values
The implemetation describes each value as a string identifying the
concrete type of the value, followed by the usual encoding of that
value.  All types to be exchanged as contents of interface values
must be registered ahead of time with the new Register function.
Although this would not seem strictly necessary, the linker garbage
collects unused types so without some mechanism to guarantee
the type exists in the binary, there could be unpleasant surprises.
Moreover, the receiver needs a reflect.Type of the value to be
written in order to be able to save the data. A Register function
seems necessary.

The implementation may require defining types in the middle of
of sending a value.  The old code never did this. Therefore there
has been some refactoring to make the encoder and decoder
work recursively.

This change changes the internal type IDs. Existing gob archives
will break with this change.  Apologies for that. If this is a deal
breaker it should be possible to create a conversion tool.

Error handling is too complicated in this code. A subsequent
change should clean it up.

R=rsc
CC=golang-dev
https://golang.org/cl/2618042
2010-10-22 11:17:40 -07:00
Robert Griesemer
3478891d12 gofmt -s -w src misc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2662041
2010-10-22 10:06:33 -07:00
Robert Griesemer
f613015e0e go ast/parser/printer: permit elision of composite literal types for composite literal elements
gofmt: added -s flag to simplify composite literal expressions through type elision where possible

R=rsc
CC=golang-dev
https://golang.org/cl/2319041
2010-10-22 10:03:14 -07:00
Russ Cox
1c8f185611 arm: 3 more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2666041
2010-10-22 05:53:03 +02:00
Russ Cox
45c48d51f7 5g: missed one case last night
R=ken2
CC=golang-dev
https://golang.org/cl/2658042
2010-10-22 05:50:45 +02:00
Russ Cox
8ffc4ec5d0 gc: implement new composite literal spec
R=ken2
CC=golang-dev
https://golang.org/cl/2350041
2010-10-21 23:17:20 -04:00
Ken Thompson
e5bd12ea90 bug right shifting 64 bits
by a variable that equals 32

R=rsc
CC=golang-dev
https://golang.org/cl/2645042
2010-10-21 18:15:00 -07:00
Rob Pike
b12f32372a Make.inc: delete unnecessary -no-inline flag to quietgcc
R=rsc
CC=golang-dev
https://golang.org/cl/2654041
2010-10-21 11:00:54 -07:00
Russ Cox
4fd12c04c5 fix windows build
R=ken2
CC=golang-dev
https://golang.org/cl/2650041
2010-10-21 13:06:17 -04:00
Russ Cox
d10963b6d7 fix arm build
R=ken2
CC=golang-dev
https://golang.org/cl/2649041
2010-10-21 13:03:59 -04:00
Russ Cox
833c06581a fix build
R=ken2
CC=golang-dev
https://golang.org/cl/2621042
2010-10-21 12:50:23 -04:00
Robert Griesemer
b57b10f992 go/parser: consume auto-inserted semi when calling ParseExpr()
Fixes #1170.

R=rsc
CC=golang-dev
https://golang.org/cl/2622041
2010-10-21 08:40:33 -07:00
Russ Cox
49084db386 ld: abandon symbol-driven archive loading
Load the entire archive file instead.
Reduces I/O by avoiding additional passes
through libraries to resolve symbols.
Go packages always need all the files anyway
(most often, all 1 of them).

R=ken2
CC=golang-dev
https://golang.org/cl/2613042
2010-10-21 11:39:47 -04:00
Russ Cox
1451695f86 encoding/binary: give LittleEndian, BigEndian specific types
Giving them specific types has the benefit that
binary.BigEndian.Uint32(b) is now a direct call, not an
indirect via a mutable interface value, so it can potentially
be inlined.

Recent changes to the spec relaxed the rules for comparison,
so this code is still valid:

	func isLittle(o binary.ByteOrder) { return o == binary.LittleEndian }

The change does break this potential idiom:

	o := binary.BigEndian
	if foo {
		o = binary.LittleEndian
	}

That must rewrite to give o an explicit binary.ByteOrder type.
On balance I think the benefit from the direct call and inlining
outweigh the cost of breaking that idiom.

R=r, r2
CC=golang-dev
https://golang.org/cl/2427042
2010-10-21 11:25:14 -04:00
David Symonds
4f6fb1b775 net: fix comment on Dial to mention unix/unixgram.
R=rsc
CC=golang-dev
https://golang.org/cl/2639041
2010-10-21 08:17:24 -04:00
Russ Cox
69188ad9bb arm: prop up software floating point
Just enough to make mov instructions work,
which in turn is enough to make strconv work
when it avoids any floating point calculations.
That makes a bunch of other packages pass
their tests.

Should suffice until hardware floating point
is available.

Enable package tests that now pass
(some due to earlier fixes).

Looks like there is a new integer math bug
exposed in the fmt and json tests.

R=ken2
CC=golang-dev
https://golang.org/cl/2638041
2010-10-21 06:56:20 +02:00
Fumitoshi Ukai
64cc5be4ad web socket: fix short Read
Fixes #1145.

R=rsc
CC=golang-dev
https://golang.org/cl/2302042
2010-10-20 22:36:06 -04:00
Fazlul Shahriar
3ee49850a0 goinstall: fix documentation typo
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2585043
2010-10-21 10:47:02 +11:00
Andrew Gerrand
06492d47cb build: add gobuilder and goplay to run.bash
gobuilder: fix build to work with new log package

R=rsc
CC=golang-dev
https://golang.org/cl/2592041
2010-10-21 10:46:10 +11:00
Yasuhiro Matsumoto
1c9dfb7647 os: correct Stat S_ISDIR on Windows
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2598041
2010-10-21 10:29:45 +11:00
Russ Cox
231fcea7e6 5l: two stack split bugs in one day
An ARM expert could probably phrase the
comparison in fewer instructions, but this works.

R=ken2
CC=golang-dev
https://golang.org/cl/2620041
2010-10-20 18:11:53 -04:00
Russ Cox
10b53867e8 encoding/hex: fix typo
Thanks to avadh4all for spotting it.

Fixes #1214.

R=r, r2
CC=golang-dev
https://golang.org/cl/2616041
2010-10-20 16:38:57 -04:00
Russ Cox
0db8d3df4c gc: select receive with implicit conversion
Fixes #1172.

R=ken2
CC=golang-dev
https://golang.org/cl/2615041
2010-10-20 16:38:25 -04:00
Ken Thompson
6096fc83cd code gen error for *(complex)++
includes array[i]++ and slice[i]++

R=rsc
CC=golang-dev
https://golang.org/cl/2614041
2010-10-20 13:18:00 -07:00
Russ Cox
6a3b29895f runtime: don't let select split stack
Fixes #1209.

R=ken2
CC=golang-dev
https://golang.org/cl/2612041
2010-10-20 15:54:17 -04:00
Russ Cox
c026c91b5c arm: fix typo in softfloat
R=kaib
CC=golang-dev
https://golang.org/cl/2608041
2010-10-20 15:35:37 -04:00
Russ Cox
c2b91d4889 6l: correct logic for morestack choice
The frame that gets allocated is for both
the args and the autos.  If together they
exceed the default frame size, we need to
tell morestack about both so that it allocates
a large enough frame.

Sanity check stack pointer in morestack
to catch similar bugs.

R=ken2
CC=golang-dev
https://golang.org/cl/2609041
2010-10-20 12:16:39 -07:00
Russ Cox
4ae9311174 arm: more tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2606041
2010-10-20 11:43:27 -04:00
Russ Cox
1142b60dad syscall/arm: correct 64-bit system call arguments
Thanks to kaib for the tip.

R=ken2
CC=golang-dev
https://golang.org/cl/2596043
2010-10-20 10:39:46 -04:00
Russ Cox
c00f9f49bb 6g: avoid too-large immediate constants
R=ken2
CC=golang-dev
https://golang.org/cl/2566042
2010-10-20 00:40:06 -04:00
Rob Pike
97f3a80d93 reflect: add InterfaceValue.Get to enable setting of an interface
value (through unsafe means) without having a reflect.Type
of type *interface{} (pointer to interface).  This is needed to make
gob able to handle interface values by a method analogous to
the way it handles maps.

R=rsc
CC=golang-dev
https://golang.org/cl/2597041
2010-10-19 21:25:28 -07:00
Rob Pike
321f0c7fe2 gob: break documentation into a separate doc.go file
R=adg, r2
CC=golang-dev
https://golang.org/cl/2596041
2010-10-19 20:39:29 -07:00
Russ Cox
17c32ad712 http: do not close connection after sending HTTP/1.0 request
Fixes #671.

R=adg, cw
CC=golang-dev
https://golang.org/cl/2431042
2010-10-19 23:29:25 -04:00
Alex Brainman
5e4963d9e8 8l: fix windows build
R=rsc
CC=golang-dev
https://golang.org/cl/2595041
2010-10-20 14:06:00 +11:00
Yasuhiro Matsumoto
a9725396c0 os: change TestForkExec so it can run on windows
R=brainman, vcc, Joe Poirier, rsc
CC=golang-dev
https://golang.org/cl/2530041
2010-10-20 09:46:24 +11:00
Nigel Tao
a3bcf4b664 nntp: remove nntp package from the standard library.
R=adg
CC=golang-dev
https://golang.org/cl/2470045
2010-10-20 09:43:27 +11:00
Russ Cox
d5dffb9f29 8l: fix references to INITDAT in windows pe.c
R=ken2
CC=golang-dev
https://golang.org/cl/2588041
2010-10-19 18:17:07 -04:00
Russ Cox
19fd5c787f 5l, 6l, 8l: link pclntab and symtab as ordinary rodata symbols
That is, move the pc/ln table and the symbol table
into the read-only data segment.  This eliminates
the need for a special load command to map the
symbol table into memory, which makes the
information available on systems that couldn't handle
the magic load to 0x99000000, like NaCl and ARM QEMU
and Linux without config_highmem=y.  It also
eliminates an #ifdef and some clumsy code to
find the symbol table on Windows.

The bad news is that the binary appears to be bigger
than it used to be.  This is not actually the case, though:
the same amount of data is being mapped into memory
as before, and the tables are still read-only, so they're
still shared across multiple instances of the binary as
they were before.  The difference is just that the tables
aren't squirreled away in some section that "size" doesn't
know to look at.

This is a checkpoint.
It probably breaks Windows and breaks NaCl more
than it used to be broken, but those will be fixed.
The logic involving -s needs to be revisited too.

Fixes #871.

R=ken2
CC=golang-dev
https://golang.org/cl/2587041
2010-10-19 18:07:19 -04:00
Russ Cox
01df088f8d 5l, 6l, 8l: separate pass to fix addresses
Lay out code before data.

R=ken2
CC=golang-dev
https://golang.org/cl/2490043
2010-10-19 13:08:17 -04:00
Luuk van Dijk
54aba2e6dd [68]l: expose genasmsym.
R=rsc
CC=golang-dev
https://golang.org/cl/2512042
2010-10-19 18:09:18 +02:00
Andrew Gerrand
f1e1fd8b46 gc: update usage string in doc.go
R=rsc, r2, r
CC=golang-dev
https://golang.org/cl/2550041
2010-10-19 09:26:11 +11:00
Rob Pike
1ffb1f2b66 netchan: add new method Hangup to terminate transmission on a channel
Fixes #1151.

R=rsc
CC=golang-dev
https://golang.org/cl/2469043
2010-10-18 15:09:43 -07:00
Florian Uekermann
e9c35ac55d big: add random number generation
Adds func (z *Int) RandIntn(src rand.Source,n *Int) *Int

R=rsc
CC=golang-dev, gri
https://golang.org/cl/2315045
2010-10-18 14:09:20 -04:00
Russ Cox
71c4244430 5l: handle jump to middle of floating point sequence
R=ken2
CC=golang-dev
https://golang.org/cl/2473042
2010-10-18 13:44:39 -04:00
Russ Cox
2012604002 runtime: fix arm softfloat again for R12
Missed a case, so now generalized.

R=ken2
CC=golang-dev
https://golang.org/cl/2540042
2010-10-18 13:24:19 -04:00
Russ Cox
9cc8e9ef48 runtime: fix amd64 build (broke by 386 support for Plan 9)
TBR=r
CC=golang-dev
https://golang.org/cl/2556041
2010-10-18 13:01:10 -04:00
Yuval Pavel Zholkover
99a10eff16 8l, runtime: initial support for Plan 9
No multiple processes/locks, managed to compile
and run a hello.go (with print not fmt).  Also test/sieve.go
seems to run until 439 and stops with a
'throw: all goroutines are asleep - deadlock!'
- just like runtime/tiny.

based on Russ's suggestions at:
http://groups.google.com/group/comp.os.plan9/browse_thread/thread/cfda8b82535d2d68/243777a597ec1612

Build instructions:
cd src/pkg/runtime
make clean && GOOS=plan9 make install
this will build and install the runtime.

When linking with 8l, you should pass -s to suppress symbol
generation in the a.out, otherwise the generated executable will not run.

This is runtime only, the porting of the toolchain has already
been done: http://code.google.com/p/go-plan9/source/browse
in the plan9-quanstro branch.

R=rsc
CC=golang-dev
https://golang.org/cl/2273041
2010-10-18 12:32:55 -04:00
Russ Cox
6ac08ba638 runtime: update arm softfloat - no more R12
R=ken2
CC=golang-dev
https://golang.org/cl/2555041
2010-10-18 12:24:59 -04:00
Russ Cox
67941bf644 gc: say that shift must be unsigned integer
R=ken2
CC=golang-dev
https://golang.org/cl/2519044
2010-10-18 11:28:57 -04:00
Russ Cox
3d0a85785a 5l: data-relocatable code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2479043
2010-10-18 11:09:59 -04:00
Luuk van Dijk
a647f59c1f [68]l: proper end of instruction ranges in dwarf.
R=rsc
CC=golang-dev
https://golang.org/cl/2542042
2010-10-17 22:35:55 +02:00
Luuk van Dijk
cc9e6b5cdb [68]l: fix off by one instruction in dwarf frame unwinding.
R=rsc
CC=golang-dev
https://golang.org/cl/2543043
2010-10-17 21:13:55 +02:00
Rob Pike
8abb8e1d20 log: update the documentation to clarify the behavior
R=rsc, PeterGo
CC=golang-dev
https://golang.org/cl/2519043
2010-10-17 09:20:23 -07:00
Russ Cox
8052786e51 5l: stop using R12 as SB
Because the SB is only good for 8k and Go programs
tend to have much more data than that, SB doesn't
save very much.  A fmt.Printf-based hello world program
has  360 kB text segment.  Removing SB makes the text
500 bytes (0.14%) longer.

R=ken2, r2, ken3
CC=golang-dev
https://golang.org/cl/2487042
2010-10-17 11:41:23 -04:00
Wei Guangjing
77eb94c032 8l: fix windows build.
R=rsc, brainman
CC=golang-dev
https://golang.org/cl/2543042
2010-10-15 23:37:14 -04:00
Russ Cox
eb6f683691 8l: function at a time code layout
R=ken2
CC=golang-dev
https://golang.org/cl/2481042
2010-10-15 20:19:57 -04:00
Rob Pike
e39bd1dd56 log: roll back the rollback of the deprecation of the old interface.
R=adg
CC=golang-dev
https://golang.org/cl/2521042
2010-10-15 13:14:29 -07:00
Russ Cox
6e18e8c82f 8l: blind attempt to fix windows build
or at least gather more information

R=ken2
CC=golang-dev
https://golang.org/cl/2515042
2010-10-15 15:29:25 -04:00
Luuk van Dijk
49a835fc97 gc: keep track of real actual type of identifiers.
R=rsc
CC=golang-dev
https://golang.org/cl/2519042
2010-10-15 21:25:34 +02:00
Russ Cox
9c20485268 6l: function at a time code layout
Also change the span-dependent jump algorithm
to use fewer iterations:

* resolve forward jumps at their targets (comefrom list)
* mark jumps as small or big and only do small->big
* record whether a jump failed to be encodable

These changes mean that a function with only small
jumps can be laid out in a single iteration, and the
vast majority of functions take just two iterations.
I was seeing a maximum of 5 iterations before; the
max now is 3 and there are fewer that get even that far.

R=ken2
CC=golang-dev
https://golang.org/cl/2537041
2010-10-15 15:18:47 -04:00
Russ Cox
837c204ada 6l, 8l: avoid recursion in asmandsz
The old code said

	if(x) {
		handle a
		return
	}
	aa = *a
	rewrite aa to make x true
	recursivecall(&aa)

The new code says

	params = copy out of a
	if(!x) {
		rewrite params to make x true
	}
	handle params

but it's hard to see that in the Rietveld diffs because
it gets confused by changes in indentation.

Avoiding the recursion makes other changes easier.

R=ken2
CC=golang-dev
https://golang.org/cl/2533041
2010-10-15 13:01:03 -04:00
Russ Cox
be2c2120d0 5l, 6l, 8l: accumulate data image during import
Using explicit relocations internally, we can
represent the data for a particular symbol as
an initialized block of memory instead of a
linked list of ADATA instructions.  The real
goal here is to be able to hand off some of the
relocations to the dynamic linker when interacting
with system libraries, but a pleasant side effect is
that the memory image is much more compact
than the ADATA list, so the linkers use less memory.

R=ken2
CC=golang-dev
https://golang.org/cl/2512041
2010-10-14 23:48:40 -04:00
Rob Pike
84834feffd log: roll back deprecation of old API to apply fix to log.Output in public release.
R=adg
CC=golang-dev
https://golang.org/cl/2525042
2010-10-14 18:02:08 -07:00
Andrew Gerrand
568eccd12d log: fix custom output bug
R=r
CC=golang-dev
https://golang.org/cl/2525041
2010-10-15 11:55:51 +11:00
Russ Cox
0b2af925db arm: enable 6 more tests after net fix
R=ken2
CC=golang-dev
https://golang.org/cl/2520042
2010-10-14 17:15:45 -04:00
Russ Cox
14d2242fb9 syscall: fix arm networking
Suggested by fango (fan.howard@gmail.com)

R=r, r2
CC=golang-dev
https://golang.org/cl/2514041
2010-10-14 16:13:44 -04:00
Rob Pike
b6cd8f869d log: delete deprecated functionality
Fixes #1195.

R=rsc
CC=golang-dev
https://golang.org/cl/2504043
2010-10-14 12:50:36 -07:00
Russ Cox
9b15ad8c22 arm: adjust recover for new reflect.call
R=ken2
CC=golang-dev
https://golang.org/cl/2471043
2010-10-14 10:45:32 -04:00
Evan Shaw
df74d8df09 smtp: new package
R=rsc, iant, agl
CC=golang-dev
https://golang.org/cl/2052042
2010-10-13 22:07:28 -04:00
Rob Pike
52e3c99cfb bufio: bulletproof UnreadRune
After a fill(), there is nothing to back up.  Make sure UnreadRune
recognizes the situation.

Fixes #1137.
(Stops the crash, but doesn't make UnreadRune usable after a Peek()).

R=rsc
CC=golang-dev
https://golang.org/cl/2498041
2010-10-13 17:12:43 -07:00
Russ Cox
d6df301774 arm: enable 8 more packages
The remaining failures include:

* something about bit operations?
	crypto/block
	encoding/binary

* something about file I/O?
	archive/tar
	archive/zip
	debug/dwarf
	debug/elf
	debug/macho
	image/png

* floating point
	cmath
	expvar
	flag
	fmt
	gob
	json
	math
	strconv
	template
	xml

* network (maybe fixed by a pending CL)
	http
	netchan
	rpc
	rpc/jsonrpc
	syslog
	websocket

* line numbers
	log

* haven't bothered / not sure
	exp/datafmt
	exp/eval
	go/printer
	os
	os/signal
	testing/quick

R=ken2
CC=golang-dev
https://golang.org/cl/2496041
2010-10-13 18:16:44 -04:00
Ken Thompson
b33f5d537f fix arm bug in reflect.call
R=rsc
CC=golang-dev
https://golang.org/cl/2475042
2010-10-13 13:24:14 -07:00
Russ Cox
d9c989fa25 various: avoid %ld etc
The Plan 9 tools assume that long is 32 bits.
We converted all instances of long to int32 when
importing the code but missed the print formats.
Because int32 is always int on the compilers we use,
it is never correct to use %lux, %ld, etc.  Convert to %ux, %d, etc.

(It matters because on 64-bit gcc, long is 64 bits,
so we were printing 32-bit quantities with 64-bit formats.)

R=ken2
CC=golang-dev
https://golang.org/cl/2491041
2010-10-13 16:20:22 -04:00
Russ Cox
085be1740a 5l, 6l, 8l: first pass cleanup
* Maintain Sym* list for text with individual
  prog lists instead of using one huge list and
  overloading p->pcond.
* Comment what each file is for.
* Move some output code from span.c to asm.c.
* Move profiling into prof.c, symbol table into symtab.c.
* Move mkfwd to ld/lib.c.
* Throw away dhog dynamic loading code.
* Throw away Alef become.
* Fix printing of WORD instructions in 5l -a.

Goal here is to be able to handle each piece of text or data
as a separate piece, both to make it easier to load the
occasional .o file and also to make it possible to split the
work across multiple threads.

R=ken2, r, ken3
CC=golang-dev
https://golang.org/cl/2335043
2010-10-13 15:51:21 -04:00
Russ Cox
d42903119b 5l, 6l, 8l: indent, outdent
This is entirely adding and removing tabs.
It looks weird but will make the diffs for the
next change easier to read.

R=ken2
CC=golang-dev
https://golang.org/cl/2490041
2010-10-13 15:19:53 -04:00
Rob Pike
dd8afb800b log: fix out-of-date package comment
R=rsc
CC=golang-dev
https://golang.org/cl/2485041
2010-10-13 11:05:45 -07:00
Andrew Gerrand
78d19b9b73 runtime: remove done TODO from SetFinalizer
R=rsc
CC=golang-dev
https://golang.org/cl/2472041
2010-10-13 14:40:02 +11:00
Nigel Tao
93159e32e7 image: add an offset to Tiled.
R=r, r2
CC=golang-dev
https://golang.org/cl/2469041
2010-10-13 12:05:21 +11:00
Rob Pike
712109f1f1 log: reduce allocations
Use a bytes.Buffer in log writing instead of string concatenation.
Should reduce the number of allocations significantly.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2417042
2010-10-12 17:27:14 -07:00
Roger Peppe
d465ea5724 netchan: export before import when testing.
Fixes some race conditions.

R=r
CC=golang-dev
https://golang.org/cl/2456041
2010-10-12 15:05:53 -07:00
Jim McGrath
8a1b2e59ef 6l: work with OS X nm/otool
6l was skipping emitting the (2 byte) symbol table if there were no imported or exported
symbols. You can't just drop the symbol table entirely - the linker dies if you have
a linkedit section but no table. You can omit the linkedit section or both the linkedit
and the dlyd parts in the right circumstances, but that seems much more risky to me.

R=rsc
CC=golang-dev
https://golang.org/cl/2421042
2010-10-12 16:52:17 -04:00
Rob Pike
12da5a90e0 log: new interface
New logging interface simplifies and generalizes.

1) Loggers now have only one output.
2) log.Stdout, Stderr, Crash and friends are gone.
	Logging is now always to standard error by default.
3) log.Panic* replaces log.Crash*.
4) Exiting and panicking are not part of the logger's state; instead
	the functions Exit* and Panic* simply call Exit or panic after
	printing.
5) There is now one 'standard logger'.  Instead of calling Stderr,
	use Print etc.  There are now triples, by analogy with fmt:
		Print, Println, Printf
	What was log.Stderr is now best represented by log.Println,
	since there are now separate Print and Println functions
	(and methods).
6) New functions SetOutput, SetFlags, and SetPrefix allow global
	editing of the standard logger's properties.   This is new
	functionality. For instance, one can call
		log.SetFlags(log.Lshortfile|log.Ltime|log.Lmicroseconds)
	to get all logging output to show file name, line number, and
	time stamp.

In short, for most purposes
	log.Stderr -> log.Println or log.Print
	log.Stderrf -> log.Printf
	log.Crash -> log.Panicln or log.Panic
	log.Crashf -> log.Panicf
	log.Exit -> log.Exitln or log.Exit
	log.Exitf -> log.Exitf (no change)

This has a slight breakage: since loggers now write only to one
output, existing calls to log.New() need to delete the second argument.
Also, custom loggers with exit or panic properties will need to be
reworked.

All package code updated to new interface.

The test has been reworked somewhat.

The old interface will be removed after the new release.
For now, its elements are marked 'deprecated' in their comments.

Fixes #1184.

R=rsc
CC=golang-dev
https://golang.org/cl/2419042
2010-10-12 12:59:18 -07:00
Russ Cox
d687ea5588 arm: fix syscall build again
R=ken2
CC=golang-dev
https://golang.org/cl/2465041
2010-10-12 15:16:47 -04:00
Russ Cox
2a19865012 arm: regenerate ztypes_linux_arm.go (fix build)
R=adg
CC=golang-dev
https://golang.org/cl/2404043
2010-10-12 10:24:55 -04:00
Mikio Hara
b390c4b9d6 syscall: add sockaddr_ll support for linux/386, linux/amd64
R=rsc, albert.strasheim
CC=golang-dev
https://golang.org/cl/2356042
2010-10-12 09:48:56 -04:00
Wei Guangjing
d3a2118b8a syscall: implement WaitStatus and Wait4() for windows
R=brainman, rsc, kardia, Joe Poirier
CC=golang-dev
https://golang.org/cl/1910041
2010-10-12 15:42:07 +11:00
Russ Cox
ded12ee4b5 arm: fix build
Effectively reverts https://code.google.com/p/go/source/detail?r=8c52477401ad
Should make ARM build pass again, but untested.
Probably still bugs involving reflect.call somewhere.

R=ken2
CC=golang-dev
https://golang.org/cl/2416042
2010-10-11 23:58:51 -04:00
Nigel Tao
a3e971d355 image: another build fix regarding ColorImage.
R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2449041
2010-10-12 14:33:37 +11:00
Nigel Tao
cd0a75f3d7 exp/draw: unbreak build.
R=adg
CC=golang-dev
https://golang.org/cl/2448041
2010-10-12 14:05:50 +11:00
Nigel Tao
b5a480f035 image: add image.Tiled type, the Go equivalent of Plan9's repl bit.
Make ColorImage methods' receiver type be a pointer.

R=r, rsc
CC=golang-dev
https://golang.org/cl/2345043
2010-10-12 13:44:11 +11:00
Eric Clark
fcc0c00228 Make.cmd: remove $(OFILES)
The linker doesn't support multiple object files (maybe it did in the past?)

R=rsc
CC=golang-dev
https://golang.org/cl/2444041
2010-10-11 22:39:37 -04:00
Russ Cox
e6ecf9765a exp/iterable: delete
Package iterable has outlived its utility.

It is an interesting demonstration, but it encourages
people to use iteration over channels where simple
iteration over array indices or a linked list would be
cheaper, simpler, and have fewer races.

R=dsymonds, r
CC=golang-dev
https://golang.org/cl/2436041
2010-10-11 22:38:42 -04:00
Andrew Gerrand
f75129894c build: fix darwin/386 build
R=rsc
CC=golang-dev
https://golang.org/cl/2443041
2010-10-12 11:49:05 +11:00
Russ Cox
054be1b6c3 ld: be less picky about bad line number info
Fixes #1175.

R=lvd
CC=golang-dev
https://golang.org/cl/2439041
2010-10-11 16:21:03 -04:00
Rob Pike
570f59c109 new command gotry.
An exercise in reflection and an unusual tool.

From the usage message:

usage: gotry [packagedirectory] expression ...
Given one expression, gotry attempts to evaluate that expression.
Given multiple expressions, gotry treats them as a list of arguments
and result values and attempts to find a function in the package
that, given the first few expressions as arguments, evaluates to
the remaining expressions as results.  If the first expression has
methods, it will also search for applicable methods.

If there are multiple expressions, a package directory must be
specified. If there is a package argument, the expressions are
evaluated in an environment that includes
	import . "packagedirectory"

Examples:
	gotry 3+4
		# evaluates to 7
	gotry strings '"abc"' '"c"' 7-5
		# finds strings.Index etc.
	gotry regexp 'MustCompile("^[0-9]+")' '"12345"' true
		# finds Regexp.MatchString

R=rsc, PeterGo, r2
CC=golang-dev
https://golang.org/cl/2352043
2010-10-11 12:40:13 -07:00
Roger Peppe
17c9c01912 netchan: zero out request to ensure correct gob decoding.
Gob decoding does not overwrite fields which are zero
in the encoder.
Fixes #1174.

R=r, r2
CC=golang-dev
https://golang.org/cl/2337044
2010-10-11 12:36:16 -07:00
Jim McGrath
3d0726b04d 6l: correct offset for __nl_symbol_ptr in Mach-O.
Fixes malformed object message from nm etc.
Fixes #1180.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2390042
2010-10-11 14:45:01 -04:00
Jim McGrath
0f6926474f 6l: fix Mach-O LC_RPATH
Fixes #1177.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/2387042
2010-10-11 14:39:41 -04:00
Sam Thorogood
3b9c9d2125 expvar: add (*Int).Set
R=golang-dev, adg, rsc
CC=golang-dev
https://golang.org/cl/2336044
2010-10-11 13:14:07 -04:00
Adam Langley
2d8e2482cc crypto/tls: make SetReadTimeout work.
Fixes #1181.

R=rsc, agl1, cw, r2
CC=golang-dev
https://golang.org/cl/2414041
2010-10-11 10:41:01 -04:00
Adam Langley
f6e2eab8e0 crypto/tls: better error messages for certificate issues.
Fixes #1146.

R=rsc, agl1
CC=golang-dev
https://golang.org/cl/2380042
2010-10-11 10:39:56 -04:00
Andrew Gerrand
1e66a21348 time: add After
Permits one to easily put a timeout in a select:

select {
case <-ch:
	// foo
case <-time.After(1e6):
	// bar
}

R=r, rog, rsc, sameer1, PeterGo, iant, nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2321043
2010-10-11 13:45:26 +11:00
Nigel Tao
fd311cb144 exp/draw/x11: support X11 vendors other than "The X.Org Foundation".
R=adg, ehog.hedge
CC=golang-dev
https://golang.org/cl/2385041
2010-10-09 11:22:14 +11:00
Ken Thompson
ed575dc2b9 bug in stack size in arm.
stack is off by one if calling
through reflect.Call

R=rsc
CC=golang-dev
https://golang.org/cl/2400041
2010-10-08 16:46:05 -07:00
Andrew Gerrand
3f032d5670 build: add GOHOSTOS and GOHOSTARCH environment variables.
Auto-detect both if not set, and if GOARCH is not set use GOHOSTARCH.

GOHOSTARCH is used to set the -m32 or -m64 flags for gcc.

This is so that 64-bit can build binaries that run on 32-bit systems.

R=rsc, iant, brainman
CC=golang-dev
https://golang.org/cl/2342045
2010-10-08 18:52:28 +11:00
Anthony Martin
5781a00e00 big: fix panic and round correctly in Rat.FloatString
R=gri, rsc
CC=golang-dev
https://golang.org/cl/2212044
2010-10-07 16:10:48 +02:00
Russ Cox
1f6f563900 5l, 8l: dregs
R=ken2
CC=golang-dev
https://golang.org/cl/2390041
2010-10-07 07:51:37 -04:00
Russ Cox
1b6282a799 runtime: fix tiny build
Reported by Jeff Allen.

R=r, r2
CC=golang-dev
https://golang.org/cl/2385042
2010-10-07 06:46:01 -04:00
Russ Cox
2408a4bbbd net: allow _ in names
Enables lookup of _jabber._tcp.gmail.com's SRV record.

Fixes #1167.

R=r, r2
CC=golang-dev
https://golang.org/cl/2353043
2010-10-07 06:45:50 -04:00
Russ Cox
7eb13b95a3 runtime: fix argument dump in traceback
Was printing words at SP instead of at FP
after shuffle due to nascent flag.

R=r, r2
CC=golang-dev
https://golang.org/cl/2316044
2010-10-07 06:45:40 -04:00
Russ Cox
53fff1e74d gc: maybe the code is only mostly dead
R=ken2
CC=golang-dev
https://golang.org/cl/2346044
2010-10-07 06:36:39 -04:00
Luuk van Dijk
2ad521c19a [568]a: precise linenumbers for statements.
R=rsc, ken2, r, rsc1
CC=golang-dev
https://golang.org/cl/2297042
2010-10-07 11:13:06 +02:00
Russ Cox
2a7019894a gc: better error for method non-call
was
x.go:7: must call (&b).*Buffer·Write

now
x.go:7: method b.Write is not an expression, must be called

Fixes #1171.

R=ken2
CC=golang-dev
https://golang.org/cl/2384042
2010-10-07 04:42:44 -04:00
Russ Cox
410927d1ad gc: elide dead code
R=ken2
CC=golang-dev
https://golang.org/cl/2365044
2010-10-07 04:42:26 -04:00
Russ Cox
42c26b734c gc: fix error for 1 <- "foo"
was
x.go:4: invalid operation: 1 <- "foo" (send to receive-only type int)

now
x.go:4: invalid operation: 1 <- "foo" (send to non-chan type int)

R=ken2
CC=golang-dev
https://golang.org/cl/2330042
2010-10-07 03:33:42 -04:00
Graham Miller
62355959c6 runtime: faster strequal, memequal
Fixes #1161.

R=rsc, cwvh
CC=golang-dev
https://golang.org/cl/2317044
2010-10-07 03:13:24 -04:00
Russ Cox
a0a7768b21 net: comment pedantry
Fixes #1167.

R=r, r2
CC=golang-dev
https://golang.org/cl/2290044
2010-10-06 11:54:53 -04:00
Russ Cox
8599a83727 runtime: correct iteration of large map values
The hash_next_and_deref was a dreg from a
previous large value scheme.

Fixes #1163.

R=r, r2
CC=golang-dev
https://golang.org/cl/2369043
2010-10-06 11:54:41 -04:00
Russ Cox
335a318c27 build: disable archive/zip for nacl (fix build)
TBR=adg
CC=golang-dev
https://golang.org/cl/2290045
2010-10-06 11:25:40 -04:00
Russ Cox
01385b400d gc: ... bug
Fixes #1165.

R=ken2
CC=golang-dev
https://golang.org/cl/2339042
2010-10-06 11:12:30 -04:00
Russ Cox
30dd191171 gc: O(1) string comparison when lengths differ
R=ken2
CC=golang-dev
https://golang.org/cl/2331045
2010-10-06 09:53:12 -04:00
Russ Cox
30edda690f ld: share asmlc
R=ken2
CC=golang-dev
https://golang.org/cl/2373043
2010-10-06 09:52:54 -04:00
Stephen Ma
8d130f5d2d http: return the correct error if a header line is too long.
R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2372042
2010-10-06 22:04:18 +11:00
Mikio Hara
4e3c58cd62 net: fix comment
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2358041
2010-10-06 21:47:25 +11:00
Albert Strasheim
8b905489ab syscall: add ucred structure for SCM_CREDENTIALS over UNIX sockets.
Working on issue 1101.

R=golang-dev, rsc, adg
CC=golang-dev
https://golang.org/cl/2338042
2010-10-06 21:32:31 +11:00
Stephen Ma
5043f0a1ad bufio: minor documentation fix.
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2301045
2010-10-06 19:39:30 +11:00
Luuk van Dijk
454f03ff0b 6g: set kind to KindUnsafePointer where appropriate in reflect structures.
R=rsc, ken2, r
CC=golang-dev
https://golang.org/cl/2355043
2010-10-05 21:17:16 +02:00
Alex Brainman
4d4b74c7b3 websocket: enable tests on windows
Fixes #1110.

R=golang-dev, adg
CC=Joe Poirier, golang-dev
https://golang.org/cl/2367041
2010-10-05 11:02:15 +11:00
Rob Pike
f73f9ad4ad fmt: allow %d on []byte
Fixes #1159.

R=rsc, adg
CC=golang-dev
https://golang.org/cl/2305043
2010-10-04 11:57:48 +02:00
Alex Brainman
17fe2479bf os: make tests work on windows
Fixes #1105.

R=golang-dev, r
CC=Joe Poirier, golang-dev
https://golang.org/cl/2343043
2010-10-04 17:31:49 +11:00
Russ Cox
a3c682267f gc: various bugs
Fixes #1016.
Fixes #1152.
Fixes #1153.

R=ken2
CC=golang-dev
https://golang.org/cl/2344042
2010-10-03 11:50:44 -04:00
Russ Cox
f481afae53 Make.pkg: remove .so before installing new one
On Linux, overwriting an mmap'ed file causes
all the MAP_PRIVATE pages to get refreshed
with the new content, even ones that have been
modified by the process that did the mmap.

One specific instance of this is that after the
dynamic linker has relocated a page from a .so,
overwriting the .so will un-relocate it, making
the next use of one of the no-longer-relocated
addresses incorrect and probably crash the
program.

Linux must go out of its way to break programs
in this way: the pages have already been copied
on write, so they're not shared with the file system
cache, and it trashes them anyway.  The manual
says the behavior when the file gets overwritten
is "undefined".  Removing before copy avoids the
undefined behavior.

R=iant
CC=golang-dev, msolo
https://golang.org/cl/2333045
2010-10-01 16:02:18 -04:00
Russ Cox
d4e6df98f4 arm: enable 9 more package tests
R=ken2
CC=golang-dev
https://golang.org/cl/2345041
2010-10-01 00:18:07 -04:00
Andrew Gerrand
03babfc626 Use Errorf where appropriate.
R=r, r2
CC=golang-dev
https://golang.org/cl/2308043
2010-10-01 14:14:18 +10:00
Andrew Gerrand
558477eeb1 fmt: add Errorf helper function
This crops up in a lot of places.
It's just a one-liner, but doesn't add any dependancies.
Seems worth it.

R=r, r2
CC=golang-dev
https://golang.org/cl/2344041
2010-10-01 14:04:55 +10:00
Ken Thompson
57858b70fb code gen error for
lv += f()
fixes asn1 and maybe more

R=rsc
CC=golang-dev
https://golang.org/cl/2341042
2010-09-30 18:02:38 -07:00
Russ Cox
52d619cfdf gc: bug308
confused by using isddd for both ONAME and OCALL

Fixes #1136.

R=ken2
CC=golang-dev
https://golang.org/cl/2314043
2010-09-30 15:05:01 -04:00
Russ Cox
779dfea487 gc: correct buffer size in sprint, add -L to show full paths
R=ken2
CC=golang-dev
https://golang.org/cl/2338041
2010-09-30 15:02:43 -04:00
Russ Cox
bee2d5b0ad gc, spec, tests: no auto-indirect of pointer to interface value
Implies no embedding of pointer to interface value either.

R=gri, iant, ken2, r, r2
CC=golang-dev
https://golang.org/cl/2289041
2010-09-30 14:59:41 -04:00
Russ Cox
6117652d8d libcgo: fix comment
R=r, r2
CC=golang-dev
https://golang.org/cl/2329042
2010-09-30 14:58:29 -04:00
Russ Cox
32b31342bd fix arm build on darwin leopard
TBR=r
CC=golang-dev
https://golang.org/cl/2333043
2010-09-30 14:48:33 -04:00
Russ Cox
7389ab8d21 runtime: serialize mcache allocation
Fixes racy regex-dna-parallel crashes.

R=r, r2
CC=golang-dev
https://golang.org/cl/2308042
2010-09-30 14:09:19 -04:00
Stephen Ma
ae5cb2c581 http: fix http handler signature changes previously missed
R=adg, rsc
CC=golang-dev
https://golang.org/cl/2303041
2010-09-30 13:22:28 +10:00
David Symonds
763cb8ad11 6prof: more accurate usage message.
R=r, r2
CC=golang-dev
https://golang.org/cl/2323042
2010-09-29 20:17:18 -07:00
Russ Cox
cf74232260 build: disable archive/zip on arm
R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2326041
2010-09-29 23:11:00 -04:00
Andrew Gerrand
a00b98ec3f archive/zip: new package for reading ZIP files
R=rsc
CC=golang-dev
https://golang.org/cl/2125042
2010-09-30 11:59:46 +10:00
Russ Cox
e642503d6f 6l, 8l: fix -K implementation
R=ken2
CC=golang-dev
https://golang.org/cl/2313041
2010-09-29 15:10:14 -04:00
Stephen Ma
fd9a5d22c6 http: revised http Handler interface
R=rsc
CC=golang-dev
https://golang.org/cl/1993043
2010-09-29 14:30:12 +10:00
Russ Cox
ffdb855be1 build: clear custom variables like GREP_OPTIONS
Fixes #946.

R=r, r2
CC=golang-dev
https://golang.org/cl/2137048
2010-09-28 23:51:55 -04:00
Russ Cox
2f7a5b3379 arm: 10 more package tests pass
R=ken2
CC=golang-dev
https://golang.org/cl/2298041
2010-09-28 23:46:36 -04:00
Russ Cox
6a1ea00d59 gotest: leave _testmain.go for "make clean" to clean up
R=r, brainman
CC=golang-dev
https://golang.org/cl/2297041
2010-09-28 22:59:16 -04:00
Russ Cox
2278ef7e1a libcgo: don't build for NaCl
R=nigeltao
CC=golang-dev
https://golang.org/cl/2290041
2010-09-28 21:53:06 -04:00
Russ Cox
5b7e50a0aa runtime: fix freebsd build
TBR=r
CC=golang-dev
https://golang.org/cl/2296041
2010-09-28 21:37:12 -04:00
Ken Thompson
a2d2341e80 arm code gen error in unsign extend
R=rsc
CC=golang-dev
https://golang.org/cl/2295041
2010-09-28 18:12:46 -07:00
Russ Cox
81041369b2 runtime: fix build
On systems where the mmap succeeds
(e.g., sysctl -w vm.mmap_min_addr=0)
it changes the signal code delivered for a
nil fault from ``page not mapped'' to
``invalid permissions for page.''

TBR=r
CC=golang-dev
https://golang.org/cl/2294041
2010-09-28 20:50:00 -04:00
Russ Cox
649aab835f runtime: add mmap of null page just in case
R=r, iant, robert.swiecki, rsc1
CC=golang-dev
https://golang.org/cl/1904044
2010-09-28 20:30:01 -04:00
Russ Cox
2ccbf83b32 6l, 8l: elfsetstring is only for .shstrtab
Was also recording for .dynstrtab which made the
table run out of space and would have caused confusion
if the ELF code tried to refer to any of the strings.

R=r
CC=golang-dev
https://golang.org/cl/2288041
2010-09-28 15:18:02 -04:00
Russ Cox
a400b0e7d7 json: do not write to unexported fields
Fixes #977.
Fixes #451.

R=r, r2
CC=golang-dev
https://golang.org/cl/2246049
2010-09-28 14:40:23 -04:00
Russ Cox
00ffd59c1a gc: fix reflect table method receiver
Fixes #451.
Fixes #770.

R=ken2
CC=golang-dev
https://golang.org/cl/2207045
2010-09-28 13:43:50 -04:00
Russ Cox
05cc83bf4e various: appease the ubuntu gcc monster
Silence warnings about not checking
return values from read and write system calls.

R=r, r2
CC=golang-dev
https://golang.org/cl/2258045
2010-09-28 13:00:13 -04:00
Russ Cox
ec13ed1fce gc: insert semicolon at EOF if needed
R=ken2, gri
CC=golang-dev
https://golang.org/cl/2208053
2010-09-28 10:35:02 -04:00
Charles L. Dorian
b233ac8f18 math: Fix off-by-one error in Ilogb and Logb.
Fixes #1141.

R=rsc
CC=adg, golang-dev
https://golang.org/cl/2194047
2010-09-28 10:15:21 -04:00
Brad Fitzpatrick
fbab1f1bad http: support HTTP/1.0 Keep-Alive
R=rsc, bradfitz1
CC=golang-dev
https://golang.org/cl/2261042
2010-09-27 21:55:04 -04:00
Russ Cox
5c3827cb9f http: correct escaping of different parts of URL
Fixes #1076.

R=adg
CC=golang-dev
https://golang.org/cl/2248045
2010-09-27 21:54:04 -04:00
Robert Griesemer
9ff4565e2b gofmt: stability improvement
There are a variety of token pairs that if printed
without separating blank may combine into a different
token sequence. Most of these (except for INT + .)
don't happen at the moment due to the spacing
introduced between expression operands. However, this
will prevent errors should the expression spacing
change.

R=rsc
CC=golang-dev
https://golang.org/cl/2207044
2010-09-27 15:03:15 -07:00
Robert Griesemer
20430f03bc go/scanner: treat EOF like a newline for purposes of semicolon insertion
R=rsc
CC=golang-dev
https://golang.org/cl/2216054
2010-09-27 12:39:55 -07:00
Rob Pike
b4e358d7e1 utf8.String: provide an Init method to avoid unnecessary allocation
when creating an array of Strings.

R=rsc
CC=golang-dev
https://golang.org/cl/2267046
2010-09-27 12:06:29 -07:00
Russ Cox
2d5e732c54 gc: eliminate duplicates in method table
Fixes #906.

R=ken2
CC=golang-dev
https://golang.org/cl/2279042
2010-09-27 14:09:10 -04:00
Russ Cox
7e92e1cbfa gc: fix non-canonical import error message
Fixes #1142.

R=ken2
CC=golang-dev
https://golang.org/cl/2218046
2010-09-27 12:59:26 -04:00
Russ Cox
929fdd860b runtime: correct stats in SysFree
R=r
CC=golang-dev
https://golang.org/cl/2254047
2010-09-27 12:50:01 -04:00
Russ Cox
9b62461a8f gc: allow select case expr = <-c
Fixes #1139.

R=ken2
CC=golang-dev
https://golang.org/cl/2194046
2010-09-27 12:04:21 -04:00
Balazs Lecz
4bfcfcf89f syscall: add inotify on Linux
R=rsc
CC=golang-dev
https://golang.org/cl/2241045
2010-09-27 11:44:26 -04:00
Wei Guangjing
6a624fa5f5 libcgo: set g, m in thread local storage for windows 386.
R=rsc
CC=golang-dev, vcc
https://golang.org/cl/2216051
2010-09-27 09:44:56 -04:00
Alex Brainman
f2db47d427 syscall: fix windows value of IPV6_V6ONLY
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2213048
2010-09-27 11:42:58 +10:00
Andrew Gerrand
b15b0a0cd9 bytes: fix typo in AddByte comment
Fixes #1140.

R=golang-dev
CC=golang-dev
https://golang.org/cl/2240043
2010-09-27 11:41:43 +10:00
Alex Brainman
e4245f2502 syscall: add IPPROTO_IPV6 and IPV6_V6ONLY const to fix nacl and windows build
R=golang-dev
CC=golang-dev
https://golang.org/cl/2204050
2010-09-25 21:24:12 +10:00
Rob Pike
2f80d328e8 utf8.String: Slice(i,j)
R=rsc
CC=golang-dev
https://golang.org/cl/2225048
2010-09-25 08:52:29 +10:00
Russ Cox
b1f44a120f gc: improve error message for x \= 0
was
x.go:2: syntax error: unexpected $undefined

now
x.go:2: syntax error: unexpected \

R=ken2
CC=golang-dev
https://golang.org/cl/2267044
2010-09-24 17:09:31 -04:00
Rob Pike
6f32c82953 utf8: Add new type String to automate string indexing by code point.
R=rsc, rog
CC=golang-dev
https://golang.org/cl/2275041
2010-09-25 06:58:34 +10:00
Russ Cox
d47266558d net: enable v4-over-v6 on ip sockets
Not all OS make that the default.
Can finally do this now that the syscall package
has the right definitions.

Fixes #679.

R=r
CC=golang-dev
https://golang.org/cl/2204048
2010-09-24 16:52:06 -04:00
Russ Cox
b031b5cfde net: fix crash in DialIP
Reported by jan.newmarch.

Fixes #1130.

R=r
CC=golang-dev
https://golang.org/cl/2212043
2010-09-24 16:50:50 -04:00
Robert Griesemer
daf64bf567 gofmt: don't substitute invalid positions with valid ones in rewrites
Fixes rewrite bug: 'f(x) -> f(0)' where functions "picked up" ... arguments.

R=rsc
CC=golang-dev
https://golang.org/cl/2279041
2010-09-24 12:58:08 -07:00
Russ Cox
5c4917ce33 syscall: rebuild z files
darwin/386
darwin/amd64
freebsd/386
freebsd/amd64
linux/386
linux/amd64
nacl/386

TBR=adg
CC=golang-dev
https://golang.org/cl/2198047
2010-09-24 15:17:20 -04:00
Russ Cox
f33ef07f38 syscall: fix socketpair in syscall_bsd
THIS WILL BREAK THE BUILD.

The z files have socketpair code in them that was
written by hand; breaking the build with this is the first
step in getting rid of that hand-written code.

R=adg
TBR=adg
CC=golang-dev
https://golang.org/cl/2197050
2010-09-24 14:59:34 -04:00
Russ Cox
dabd9fe920 syscall: work harder to avoid doing this ever again
TBR=adg
CC=golang-dev
https://golang.org/cl/2218044
2010-09-24 14:52:10 -04:00
Russ Cox
5bd0bea7d2 syscall: fix mkall.sh for nacl
TBR=adg
CC=golang-dev
https://golang.org/cl/2208050
2010-09-24 14:38:17 -04:00
Russ Cox
908b0683e1 syscall: fix permissions on mksysnum_nacl.sh
TBR=adg
CC=golang-dev
https://golang.org/cl/2208049
2010-09-24 11:03:54 -07:00
Russ Cox
9a96fb3a29 mkall.sh, mkerrors.sh: work more broadly
work on FreeBSD even without /usr/src/sys.
work on systems where gcc -static is broken.

TBR so I can test my semi-automated z builder.

TBR=adg
CC=golang-dev
https://golang.org/cl/2215046
2010-09-24 13:37:02 -04:00
Russ Cox
fb7e175d1f debug/proc: ... changes (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2229047
2010-09-24 13:12:50 -04:00
Russ Cox
d8fc38c7b8 crypto/ocsp: update for asn1 change (fix build)
TBR=gri
CC=golang-dev
https://golang.org/cl/2221044
2010-09-24 13:08:35 -04:00
Russ Cox
8206bafb22 asn1: make interface consistent with json
Replace Marshal with MarshalToMemory
(no one was using old Marshal anyway).

Swap arguments to Unmarshal.

Fixes #1133.

R=agl1
CC=golang-dev
https://golang.org/cl/2249045
2010-09-24 12:34:18 -04:00
Russ Cox
1d315a8abd gc: printing of ...
R=ken2
CC=golang-dev
https://golang.org/cl/2218043
2010-09-24 12:29:20 -04:00
Dan Sinclair
8d87ccad0b xml: Allow entities inside CDATA tags
Fixes #1112.

R=rsc
CC=golang-dev
https://golang.org/cl/2255042
2010-09-24 12:23:01 -04:00
Russ Cox
2ee420fa5e ... changes
R=golang-dev, gri
CC=golang-dev
https://golang.org/cl/2273042
2010-09-24 11:55:48 -04:00
Russ Cox
75dd8fdb34 gc: ... changes
R=ken2, ken3
CC=golang-dev
https://golang.org/cl/2208047
2010-09-24 11:55:30 -04:00
Russ Cox
6cf1a34402 build: use full path when compiling libraries
Makes gdb display full paths in backtrace.
Dropped during the most recent reorg.

R=r
CC=golang-dev
https://golang.org/cl/2216047
2010-09-24 11:55:16 -04:00
Russ Cox
34d413f562 runtime: fix unwindstack crash
Bug and fix identified by Alexey Gokhberg.
Fixes #1135.

R=r, brainman
CC=golang-dev
https://golang.org/cl/2198046
2010-09-23 23:04:32 -04:00
Rob Pike
e439345dfd bufio.UnreadRune: fix bug at EOF
Fixes #1132.

R=rsc
CC=golang-dev
https://golang.org/cl/2215045
2010-09-24 12:28:14 +10:00
Nigel Tao
099d7b4d1d exp/draw: remove "this isn't ready yet" comments.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2248046
2010-09-24 12:15:49 +10:00
Peter Mundy
bfb127612a os: check for valid arguments in windows Readdir
Fixes #1129.

R=rsc, brainman
CC=Joe Poirier, golang-dev
https://golang.org/cl/2211045
2010-09-23 22:06:59 -04:00
Russ Cox
7c9f0f0109 html: disable print
Everything is incomplete.
Let's not make noise like this a habit.

R=nigeltao_gnome
CC=golang-dev
https://golang.org/cl/2272041
2010-09-23 22:05:42 -04:00
Russ Cox
052cd29dd6 nacl: update instructions for new SDK
R=nigeltao_gnome, nigeltao
CC=golang-dev
https://golang.org/cl/2253042
2010-09-23 22:05:20 -04:00
Rob Pike
344600f689 fmt/Printf: document and tweak error messages produced for bad formats
R=golang-dev, adg
CC=golang-dev
https://golang.org/cl/2198044
2010-09-24 11:53:26 +10:00
Nigel Tao
d181625b9c exp/spacewar: fix build.
R=rsc
CC=golang-dev
https://golang.org/cl/2265042
2010-09-24 11:07:52 +10:00
Robert Griesemer
44b3b20524 gofmt: preserve syntactically relevant blanks between ints and tokens that start with a '.' (2nd attempt)
R=rsc
CC=golang-dev
https://golang.org/cl/2270042
2010-09-23 14:56:44 -07:00
Robert Griesemer
0716d95092 gofmt: don't remove syntactically relevant blank in f(42 ...)
R=rsc
CC=golang-dev
https://golang.org/cl/2246046
2010-09-23 14:20:13 -07:00
Russ Cox
f3549d8323 io/ioutil: use _test not _obj in test
Fixes: make clean; make test

R=gri
CC=golang-dev
https://golang.org/cl/2234044
2010-09-23 14:31:44 -04:00
Roger Peppe
81ba399a6a bytes, strings: change lastIndexFunc to use DecodeLastRune
R=r
CC=golang-dev, rsc
https://golang.org/cl/2271041
2010-09-23 20:40:11 +10:00
Roger Peppe
f11271b82e utf8: add DecodeLastRune and DecodeLastRuneInString to
enable traversing rune-by-rune backwards in strings

R=r, rsc
CC=golang-dev
https://golang.org/cl/2192050
2010-09-23 20:33:52 +10:00
Rob Pike
1959c3ac5b tests: fix prints
- delete unnecessary newlines
- make sure formatted prints call the formatting routines

R=adg
CC=golang-dev
https://golang.org/cl/2225046
2010-09-23 13:48:56 +10:00
Alex Brainman
c10865ce53 syscall: implement windows version of Utimes()
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2215044
2010-09-23 12:36:52 +10:00
Nigel Tao
43527e9dbb netchan: fix comment typo.
R=adg
CC=golang-dev
https://golang.org/cl/2204047
2010-09-23 11:32:11 +10:00
Roger Peppe
0f17173f79 exp/draw: add Point.Eq, Point.Mul, Point.Div, Rectangle.Size methods
R=nigeltao, nigeltao_golang, rsc
CC=golang-dev, r
https://golang.org/cl/2192048
2010-09-23 10:58:59 +10:00
Andrew Gerrand
1a8bd6715d http: fix redirect test for international users
R=r
CC=golang-dev
https://golang.org/cl/2197047
2010-09-23 10:40:07 +10:00
Ian Lance Taylor
7b175236cb http: Change redirect test URL, as the old one now fails.
R=rsc, r2
CC=golang-dev
https://golang.org/cl/2267042
2010-09-22 14:20:15 -07:00
Robert Griesemer
a6b6142f30 gofmt: support for ... after actual arguments
Pending acceptance of the proposed language change.

R=rsc
CC=golang-dev
https://golang.org/cl/2193048
2010-09-22 14:05:14 -07:00
Robert Griesemer
3487495eb0 suffixarray: cleanup per suggestion from Roger Peppe
R=rsc
CC=golang-dev
https://golang.org/cl/2213045
2010-09-22 11:03:57 -07:00
Andrew Gerrand
ad9042bdfa http: don't always escape all reserved chars (fix build)
R=nigeltao, nigeltao_golang
CC=golang-dev
https://golang.org/cl/2206044
2010-09-22 16:59:35 +10:00
Andrew Gerrand
d093bdbe7e http: escape _all_ reserved characters as per the RFC
R=r
CC=golang-dev
https://golang.org/cl/2199043
2010-09-22 16:25:26 +10:00
Robert Griesemer
22974fbe8e suffixarray: a package for creating suffixarray-based indexes
This is a replacement for pending CL 2219042. It only contains
the raw suffixarray functionality with two methods:

- New       create a new index from some data
- Lookup    lookup occurences of a bytes slice in the data

Any other functionality (dealing with multiple data sets and
the corresponding position lists) is generic and doesn't have
to be part of this package.

Known performance bug: This implementation works fine for data sets
up to several megabytes as long as it doesn't contain very long
contiguous sequences of equal bytes. For instance, index creation for
all .go files under GOROOT (250KLOCs, approx. 9MB) takes ~50s on
2.66 GHz Intel Xeon as long as test/fixedbugs/257.go is excluded.
With that file, index creation times takes several days. 257.go contains
a string of 1M smiley faces.

There are more sophisticated suffixarray creation algorithms which
can handle very long common prefixes. The implementation can be
updated w/o the need to change the interface.

R=rsc, r, PeterGo
CC=golang-dev
https://golang.org/cl/2265041
2010-09-21 23:12:57 -07:00
Anthony Martin
176364900e fmt: support '*' for width or precision
R=r
CC=golang-dev
https://golang.org/cl/2237044
2010-09-22 16:10:38 +10:00
Russ Cox
b7cb844ac8 build: make all.bash run on Ubuntu ARM
Sent from my phone.

R=adg
CC=golang-dev
https://golang.org/cl/2192049
2010-09-22 15:30:42 +10:00
Alex Brainman
a071853015 os: make Open() O_APPEND flag work on windows
Fixes #1124.
Implementation is suggested by Skip.
Test is suggested by PeterGo.

R=r, PeterGo, rsc
CC=golang-dev, skip.tavakkolian
https://golang.org/cl/2256041
2010-09-22 13:12:25 +10:00
Roger Peppe
8ee986570a strings: fix minor bug in LastIndexFunc
R=r, rsc
CC=golang-dev
https://golang.org/cl/2250042
2010-09-21 22:58:09 -04:00
Russ Cox
b11740fb6d build: fixes for native arm build
R=kaib
CC=golang-dev
https://golang.org/cl/2254044
2010-09-21 22:41:32 -04:00
Russ Cox
a2450c1456 cgo: bug fixes
* Add documentation about array arguments.  Fixes issue 1125.
* Do not interpret x, y := z, w as special errno form.  Fixes issue 952.
* Fix nested Go calls (brainman).  Fixes issue 907.

R=r
CC=golang-dev
https://golang.org/cl/2214044
2010-09-21 22:41:19 -04:00
Nigel Tao
58795ea31a exp/4s, exp/nacl/av: sync to recent exp/draw changes.
R=rsc
CC=golang-dev
https://golang.org/cl/2257042
2010-09-22 12:20:56 +10:00
Ian Lance Taylor
7d03d0ec6b syscall: Use vsyscall for syscall.Gettimeofday and .Time on linux amd64.
Regenerate zsyscall_linux_*.go files with recent changes to
mksyscall.sh.

Add socketpair to syscall_linux_amd64.go; for some reason it
was in the generated file but not in the source file.

R=rsc, r2
CC=golang-dev
https://golang.org/cl/2190044
2010-09-21 06:49:56 -07:00
Rob Pike
4659f6de38 regexp: delete Iter methods
They are unused and not that useful anyway.

R=rsc
CC=golang-dev
https://golang.org/cl/2225045
2010-09-21 21:21:44 +10:00
Alex Brainman
a33ad247a6 env.bash: fix building in directory with spaces in the path.
Fixes #1122.
Thanks to BigBoss1964 for the solution.

R=golang-dev, r2
CC=golang-dev
https://golang.org/cl/2246042
2010-09-21 16:43:31 +10:00
Nigel Tao
bd77a889e6 exp/nacl/av: update color to max out at 1<<16-1 instead of 1<<32-1.
Fix missing return in Set(x, y, color).

R=r
CC=golang-dev
https://golang.org/cl/2256042
2010-09-21 16:13:19 +10:00
Robert Griesemer
c20e024df3 godoc: default filter file name should be ""
R=rsc
CC=golang-dev
https://golang.org/cl/2241043
2010-09-20 16:19:17 -07:00
Ken Thompson
103d756663 loader fix
static init redo

R=rsc
CC=golang-dev
https://golang.org/cl/2254041
2010-09-20 14:23:25 -07:00
Luuk van Dijk
eb572e0174 6l/8l: emit DWARF frame info.
R=rsc, ken2, r
CC=golang-dev
https://golang.org/cl/2151044
2010-09-20 18:44:19 +02:00
Adam Langley
8e5f673dac crypto/x509, crypto/tls: improve root matching and observe CA flag.
The key/value format of X.500 names means that it's possible to encode
a name with multiple values for, say, organisation. RFC5280
doesn't seem to consider this, but there are Verisign root
certificates which do this and, in order to find the correct
root certificate in some cases, we need to handle it.

Also, CA certificates should set the CA flag and we now check
this. After looking at the other X.509 extensions it appears
that they are universally ignored/bit rotted away so we ignore
them.

R=rsc
CC=golang-dev
https://golang.org/cl/2249042
2010-09-20 12:17:31 -04:00
Adam Langley
6989f6e312 Fix certificate validation.
asn1: add support for T61String because this is the string type which
    several www.google.com certificates are now using for fields like
    CommonName
tls: force a handshake in Dial so that certificates are ready
    afterwards.

Fixes #1114.

R=rsc
CC=golang-dev
https://golang.org/cl/2216043
2010-09-20 10:32:08 -04:00
Rob Pike
724886b0c0 netchan: fix unimportant typo in test error call.
R=adg
CC=golang-dev
https://golang.org/cl/2211044
2010-09-20 17:24:40 +10:00
Rob Pike
da705c6212 netchan: provide a method (Importer.Errors()) to recover protocol errors.
R=rsc
CC=golang-dev
https://golang.org/cl/2229044
2010-09-20 15:28:38 +10:00
Alex Brainman
8a313e201a Make.inc: make GOOS detection work on windows
R=rsc, Joe Poirier, r
CC=golang-dev
https://golang.org/cl/2248041
2010-09-20 15:19:13 +10:00
Russ Cox
950ee18366 syscall: fix NaCl
missing from last CL, sorry

R=r
CC=golang-dev
https://golang.org/cl/2214043
2010-09-19 23:28:45 -04:00
Russ Cox
d4baf3ccb7 runtime: better panic for send to nil channel
*Much* better on NaCl, where memory faults are deadly.

R=r
CC=golang-dev
https://golang.org/cl/2249041
2010-09-19 23:28:12 -04:00
Russ Cox
e769342614 nacl: fix zero-length writes
NaCl rejects zero-length write using nil pointer.

R=r
CC=golang-dev
https://golang.org/cl/2237042
2010-09-19 22:52:30 -04:00
Russ Cox
af12feb8d5 6l, 8l: clean up ELF code, fix NaCl
R=r
CC=golang-dev
https://golang.org/cl/2221042
2010-09-19 22:10:34 -04:00
Nigel Tao
afbee9d87d exp/draw/x11: mouse location is a signed integer.
R=r
CC=golang-dev
https://golang.org/cl/2192043
2010-09-20 10:18:09 +10:00
Rob Pike
1e4b1f9337 netchan: handle closing of channels.
This also silences some misleading logging.
Also improve logging.

R=rsc
CC=golang-dev
https://golang.org/cl/2245041
2010-09-20 10:14:39 +10:00
Russ Cox
63623ba2d8 5l: avoid fixed buffers in list
R=ken2
CC=golang-dev
https://golang.org/cl/2204045
2010-09-19 19:44:52 -04:00
Rob Pike
c8b3d02939 gob: make robust when decoding a struct with non-struct data.
The decoder was crashing when handling an rpc that expected
a struct but was delivered something else.  This diagnoses the
problem.  The other direction (expecting non-struct but getting
one) was already handled.

R=rsc
CC=golang-dev
https://golang.org/cl/2246041
2010-09-20 07:37:06 +10:00
Rob Pike
42a61b920e windows: fix netchan test by using 127.0.0.1.
Re-enable the test on Windows.

R=brainman, alex.brainman
CC=golang-dev
https://golang.org/cl/2244041
2010-09-18 11:43:10 +10:00
Alex Brainman
289432daff pkg/Makefile: disable netchan test to fix windows build
R=r
CC=golang-dev
https://golang.org/cl/2225042
2010-09-18 11:09:08 +10:00
Alex Brainman
9997dae7a3 os: make RemoveAll() work on windows
R=golang-dev, rsc1
CC=golang-dev
https://golang.org/cl/2212041
2010-09-17 12:35:34 +10:00
Robert Griesemer
7534d40f64 fix various comments
(os package comments were duplicates)

R=rsc
CC=golang-dev
https://golang.org/cl/2205042
2010-09-16 18:21:01 -07:00
Ken Thompson
d348971103 add readonly flag to static initialization
R=rsc
CC=golang-dev
https://golang.org/cl/2187042
2010-09-16 16:42:38 -07:00
Rob Pike
19075ea609 netchan: add a cross-connect test.
Suggested in a bug report (since addressed) by Axel Schreiner.

R=rsc
CC=golang-dev
https://golang.org/cl/2228041
2010-09-17 07:12:54 +10:00
Robert Griesemer
b410be31b6 godoc: show "Last update" info for directory listings.
Use -timestamps=false flag to disable.

(This used to be shown on the front-page below the
build information with the old godoc. However, the
time stamps are directory-specific and should be
shown with the directory.)

R=rsc
CC=golang-dev
https://golang.org/cl/2233044
2010-09-16 13:45:40 -07:00
Russ Cox
d19fcd0784 gc: spell debug['u'] correctly
R=ken2
CC=golang-dev
https://golang.org/cl/2214042
2010-09-16 15:50:46 -04:00
Russ Cox
555f5b6b24 gc: make sure path names are canonical
R=ken2
CC=golang-dev
https://golang.org/cl/2209042
2010-09-16 15:37:57 -04:00
Robert Griesemer
fcb24e8c62 gofmt: add another exception to test cases
R=rsc
CC=golang-dev
https://golang.org/cl/2233043
2010-09-16 11:03:28 -07:00
Robert Griesemer
599f758d42 godoc: don't use quadratic algorithm to filter paths
R=rsc
CC=golang-dev
https://golang.org/cl/2212042
2010-09-16 10:40:07 -07:00
Eric Clark
b610a78b6e cgo: show preamble gcc errors
Fixes #1081

R=rsc
CC=golang-dev
https://golang.org/cl/2112046
2010-09-16 13:38:23 -04:00
Fazlul Shahriar
dd0dec6290 net/dict: parse response correctly + typo
* SHOW DB responds with a
  "110 n databases present - text follows" -- parse it.
* Doing a Define() on a non-existing word gives error
  "invalid definition count: no", when we really
  want "552 no match".

R=rsc
CC=golang-dev
https://golang.org/cl/2211041
2010-09-16 13:37:35 -04:00
Rob Pike
381ab58e2c netchan: fix bug for imported send.
Also add a bit of debugging and sanitation code.
Fixes #769.

R=adg
CC=golang-dev
https://golang.org/cl/2206042
2010-09-16 13:59:31 +10:00
Robert Griesemer
304d72be8c os: error in documentation
R=r
CC=golang-dev
https://golang.org/cl/2225041
2010-09-15 15:38:16 -07:00
Robert Griesemer
108f5c913c godoc: only show directories containing true package files
(ignore directories containing *.go files that don't
actually start with a package clause)

R=r
CC=golang-dev
https://golang.org/cl/2223041
2010-09-15 15:07:52 -07:00
Ken Thompson
abb73a4a86 fix line number printing
with //line directives.

R=rsc
CC=golang-dev
https://golang.org/cl/2224041
2010-09-15 14:32:09 -07:00
Russ Cox
34706ac974 libmach: fix build on arm host
Fixes #1079.

R=r, trufae, fgergo
CC=golang-dev
https://golang.org/cl/2103048
2010-09-15 16:52:11 -04:00
Rob Pike
8d831de685 netchan: make -1 unlimited, as advertised.
R=adg
CC=golang-dev
https://golang.org/cl/2198042
2010-09-14 23:41:37 -07:00
Robert Griesemer
7f0ddd682a godoc: better handling of deep directory trees
also: fix a logic error with filter use at startup

R=rsc
CC=golang-dev
https://golang.org/cl/2184044
2010-09-14 18:58:09 -07:00
Robert Griesemer
4398768b84 godoc: atomically update filter file
R=rsc
CC=golang-dev
https://golang.org/cl/2206041
2010-09-14 16:54:38 -07:00
Robert Griesemer
bce8f51b2b godoc: use correct delay time (bug fix)
R=rsc
CC=golang-dev
https://golang.org/cl/2201041
2010-09-14 13:59:45 -07:00
Robert Griesemer
b6f294def3 godoc documentation: fixed typo, more precise comment
R=iant
CC=golang-dev
https://golang.org/cl/2184042
2010-09-14 12:03:26 -07:00
Robert Griesemer
ec81b1259b godoc: better support for directory trees for user-defined
file systems provided via -path

R=rsc
CC=golang-dev
https://golang.org/cl/2182041
2010-09-14 11:16:36 -07:00
Russ Cox
d64a2bddf0 tabs
TBR=lvd
CC=golang-dev
https://golang.org/cl/2194041
2010-09-14 11:16:57 -04:00
Russ Cox
b7e9e9188a 6l, 8l: make etext accurate; introduce rodata, erodata.
Makes binaries work with 6cov again.

R=ken2
CC=golang-dev
https://golang.org/cl/2192041
2010-09-14 11:13:04 -04:00
Sebastien Binet
caf3b4a749 Preliminary support for 'copy' builtin function in exp/eval
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/2157042
2010-09-14 17:25:34 +10:00