If ParseUint is like ParseInt it should have the same parameter
names, thus rename b to to base as in ParseInt's documentation.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6453152
with table changes.
NOTE: there is no test for this, but 1) the code has now the same
control flow as scan in exp/locale/collate/contract.go, which is
tested and 2) Builder verifies the generated table so bugs in this
code are quickly and easily found (which is how this bug was discovered).
R=r
CC=golang-dev
https://golang.org/cl/6461082
The main table will need to get a slightly different collation table as the one
used by regtest, as the regtest is based on the standard UCA DUCET, while
the locale-specific tables are all based on a CLDR root table.
This change allows changing the table without affecting the regression test.
R=r
CC=golang-dev
https://golang.org/cl/6453089
If we aren't explicit about the KeyUsages, the verifier
will treat the certificate as a server certificate and require
it to have a ExtKeyUsageServerAuth key usage.
R=golang-dev
CC=golang-dev
https://golang.org/cl/6453148
- pprof is a perl script, so go command should invoke
perl instead of trying to run pprof directly;
- pprof should use "go tool nm" unconditionally on windows,
no one else can extract symbols from Go program;
- pprof should use "go tool nm" instead of "6nm".
Fixes#3879.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6445082
Before, pointers always appeared as 0x1234ABCD. This CL
keeps that as the default for %p and %v, but lets explicit
numeric verbs override the default.
Fixes#3936.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6441152
Only affects some tests and none seem likely to be problematic, but let's fix them.
Fixes#3971.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6463060
When manipulating the stack pointer use the UESP register instead
of the ESP register, since the UESP register is the one that gets
restored from the machine context. Fixes broken tests on netbsd/386.
R=golang-dev, minux.ma, r, bsiegert
CC=golang-dev
https://golang.org/cl/6465054
This CL adds a step to the build procedure for cgo programs. It uses 'ld -r'
to combine all gcc compiled object file and generate a relocatable object file
for our ld. Additionally, this linking step will combine some static linking
gcc library into the relocatable object file, so that we can use libgcc,
libmingwex and libmingw32 without problem.
Fixes#3261.
Fixes#1741.
Added a testcase for linking in libgcc.
TODO:
1. still need to fix the INDIRECT_SYMBOL_LOCAL problem on Darwin/386.
2. still need to enable the libgcc test on Linux/ARM, because 5l can't deal
with thumb libgcc.
Tested on Darwin/amd64, Darwin/386, FreeBSD/amd64, FreeBSD/386, Linux/amd64,
Linux/386, Linux/ARM, Windows/amd64, Windows/386
R=iant, rsc, bradfitz, coldredlemur
CC=golang-dev
https://golang.org/cl/5822049
Now that the parser passes all tests in the test suite,
it is no longer necessary to keep track of which tests
pass and which don't. So remove the testlogs directory
and the code that uses it.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6453124
This currently fails on NetBSD due to the cloned file descriptors
that result from opening /dev/urandom. Disable the additional checking
until this is investigated and properly fixed.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6443129
Disable the crash handler test on NetBSD until I can figure out why
it triggers failures in later tests.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6460090
All of the remaining tests that had as status of PARSE rather than PASS had
good reasons for not passing the render-and-reparse step: the correct parse tree is
badly formed, so when it is rendered out as HTML, the result doesn't parse into the
same tree. So add them to the list of tests where that step is skipped.
Also, I discovered that it is possible to end up with HTML elements (not just text)
inside a raw text element through reparenting. So change the rendering routines to
handle that situation as sensibly as possible (which still isn't very sensible, but
this is HTML5).
R=nigeltao
CC=golang-dev
https://golang.org/cl/6446137
Optimize some common cases.
benchmark old ns/op new ns/op delta
BenchmarkScanFile 718907 667960 -7.09%
benchmark old MB/s new MB/s speedup
BenchmarkScanFile 23.03 25.51 1.11x
R=r
CC=golang-dev
https://golang.org/cl/6454150
When generating replacement elements for an <isindex> tag, the old
addSyntheticElement method was producing the wrong nesting. Replace
it with parseImpliedToken.
Pass the one remaining test in the test suite.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6453114
If a tag doesn't have a closing '>', it isn't considered a tag;
it is just ignored and EOF is returned instead.
Pass one additional test in the test suite.
Change tokenizer tests to match correct behavior.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6454131
In HTML content, having a self-closing tag is a parse error unless
the tag would be self-closing anyway (like <img>). The only place a
self-closing tag actually makes a difference is in XML-based foreign
content.
Pass 1 additional test.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6450109
Also simplified parsing of interface
types since they can only contain
methods (and no embedded interfaces)
in the export data.
R=rsc
CC=golang-dev
https://golang.org/cl/6446084
The keyword reprents an untyped nil and is useful for
passing nil values to methods and functions. The
nil will be promoted to the appropriate type when
used; if a type cannot be assigned, an error results.
R=rsc, dsymonds
CC=golang-dev
https://golang.org/cl/6459056
Although I don't use PAX enabled ARM kernels, PAX
does have support for ARM, so we're better off add
PT_PAX_FLAGS now in case people use PAX kernels.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6453092
Surrogate halves are part of UTF-16 and should never appear in UTF-8.
(The rune that two combined halves represent in UTF-16 should
be encoded directly.)
Encoding: encode as RuneError.
Decoding: convert to RuneError, consume one byte.
This requires changing:
package unicode/utf8
runtime for range over string
Also added utf8.ValidRune and fixed bug in utf.RuneLen.
Fixes#3927.
R=golang-dev, rsc, bsiegert
CC=golang-dev
https://golang.org/cl/6458099
If a table contained whitespace, text nodes would not get foster parented
correctly.
Pass 1 additional test.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6459054
Depends on CL 6197045.
Result obtained on Core i7 620M, Darwin/amd64:
benchmark old ns/op new ns/op delta
BenchmarkComplex128DivNormal 57 28 -50.78%
BenchmarkComplex128DivNisNaN 49 15 -68.90%
BenchmarkComplex128DivDisNaN 49 15 -67.88%
BenchmarkComplex128DivNisInf 40 12 -68.50%
BenchmarkComplex128DivDisInf 33 13 -61.06%
Result obtained on Core i7 620M, Darwin/386:
benchmark old ns/op new ns/op delta
BenchmarkComplex128DivNormal 89 50 -44.05%
BenchmarkComplex128DivNisNaN 307 802 +161.24%
BenchmarkComplex128DivDisNaN 309 788 +155.02%
BenchmarkComplex128DivNisInf 278 237 -14.75%
BenchmarkComplex128DivDisInf 46 22 -52.46%
Result obtained on 700MHz OMAP4460, Linux/ARM:
benchmark old ns/op new ns/op delta
BenchmarkComplex128DivNormal 1557 465 -70.13%
BenchmarkComplex128DivNisNaN 1443 220 -84.75%
BenchmarkComplex128DivDisNaN 1481 218 -85.28%
BenchmarkComplex128DivNisInf 952 216 -77.31%
BenchmarkComplex128DivDisInf 861 231 -73.17%
The 386 version has a performance regression, but as we have
decided to use SSE2 instead of x87 FPU for 386 too (issue 3912),
I won't address this issue.
R=dsymonds, mchaten, iant, dave, mtj, rsc, r
CC=golang-dev
https://golang.org/cl/6024045
The <title> element was getting removed from the stack of open elements,
when its parent, the <head> element should have been removed instead.
Pass 2 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6449101
This is an attempt to fix windows build. Will restore
once we know what the problem is.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6461046
our old choice is not working properly at least on VFPv2 in
ARM1136JF-S (it's not preserved across float64->float32 conversions).
Fixes#3745.
R=dave, rsc
CC=golang-dev
https://golang.org/cl/6344078
Enhances test/run.go to support testing other directories
Will enable stdio tests on Windows in a follow-up CL.
R=golang-dev, alex.brainman, rsc
CC=golang-dev
https://golang.org/cl/6220049
When an element (like <nobr> or <p>) was implicitly closed by another
start tag, it would keep foster parenting from working because
the check for what was on top of the stack of open elements was
in the wrong place.
Move the check to addChild.
Pass 2 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6460045
Hold ForkLock during dup of fd + cloexec in the net pkg,
per the locking policy documented in syscall/exec_unix.go.
R=golang-dev, dsymonds, adg
CC=golang-dev
https://golang.org/cl/6457080
Since NUL usually terminates strings in underlying syscalls, allowing
it when converting string arguments is a security risk, especially
when dealing with filenames. For example, a program might reason that
filename like "/root/..\x00/" is a subdirectory or "/root/" and allow
access to it, while underlying syscall will treat "\x00" as an end of
that string and the actual filename will be "/root/..", which might
be unexpected. Returning EINVAL when string arguments have NUL in
them makes sure this attack vector is unusable.
R=golang-dev, r, bradfitz, fullung, rsc, minux.ma
CC=golang-dev
https://golang.org/cl/6458050
Too many people use it without reading what it does.
Those people want ReadBytes or ReadString.
Fixes#3906.
R=golang-dev, iant, r
CC=golang-dev
https://golang.org/cl/6442087
The improvement is obtained by eliminating the zero
initialization of a large structure that is only
needed when the fast path fails.
Also add a missing roundtrip test for float32s.
benchmark old ns/op new ns/op delta
BenchmarkAppendFloatDecimal 301 180 -40.20%
BenchmarkAppendFloat 486 388 -20.16%
BenchmarkAppendFloatExp 492 383 -22.15%
BenchmarkAppendFloatNegExp 478 370 -22.59%
BenchmarkAppendFloatBig 650 541 -16.77%
BenchmarkAppendFloat32Integer 308 180 -41.56%
BenchmarkAppendFloat32ExactFraction 449 333 -25.84%
BenchmarkAppendFloat32Point 494 390 -21.05%
BenchmarkAppendFloat32Exp 488 387 -20.70%
BenchmarkAppendFloat32NegExp 488 378 -22.54%
R=r, rsc
CC=golang-dev, remy
https://golang.org/cl/6346081
The content of an HTML <title> element is RCDATA, but the content of an SVG
<title> element is parsed as tags. Now the parser doesn't go into RCDATA
mode in foreign content.
Pass 4 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6448111
I have C functions implemented in .syso file (rather than .so or inlined in .go file).
W/o this change the gcc invocation fails with undefined symbols.
R=minux.ma, rsc
CC=golang-dev
https://golang.org/cl/6352076
The compiler is incorrectly rejecting switches on arrays of
comparable types. It also doesn't catch incomparable structs
when typechecking the switch, leading to unreadable errors
during typechecking of the generated code.
Fixes#3894.
R=rsc
CC=gobot, golang-dev, r, remy
https://golang.org/cl/6442074
These aren't needed for scalar multiplication, but since we export a
generic Add function we should handle it.
This change also corrects two bugs in p224Contract that it turned up.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6458076
PAX systems are Linux systems that are more paranoid about memory permissions.
These flags tell them to relax when running Go binaries.
Fixes#47.
R=iant
CC=golang-dev
https://golang.org/cl/6326054
This removes some (non-short only) tests that involved connections to
the outside world and thus were flakey. This does remove some test
coverage of the root fetchers on non-Windows platforms, but the right
place for that is crypto/x509.
R=golang-dev, krautz, rsc
CC=golang-dev
https://golang.org/cl/6455085
We already support reading ECDSA certificates and this change adds
write support.
R=golang-dev, bradfitz, rsc
CC=golang-dev
https://golang.org/cl/6422046
for dealing with CLDR files:
- Add now taxes a list of indexes of colelems that are variables. Checking and
handling is now done by the Builder. VariableTop is now also properly generated
using the Build method.
- Introduced separate Builder, called Tailoring, for creating tailorings of root
table. This clearly separates the functionality for building a table based on
weights (the allkeys* files) versus tables based on LDML XML files.
- Tailorings are now added by two calls instead of one: SetAnchor and Insert.
This more closely reflects the structure of LDML side and simplifies the
implementation of both the client and library side. It also preserves
some information that is otherwise hard to recover for the Builder.
- Allow the LDML XML element extend to be passed to Insert. This simplifies
both client and library implementation.
R=r
CC=golang-dev
https://golang.org/cl/6454061
Don't print unexported struct fields; their values are
not accessible via reflection.
Fixes#3898.
Also:
- added support for arrays
- print empty maps, arrays, slices, structs on one line
for a denser output
- added respective test cases
R=r
CC=golang-dev
https://golang.org/cl/6454089
Process a package's object in a reproducible
order (rather then in map order) so that we
get error messages in reproducible order.
R=r
CC=golang-dev
https://golang.org/cl/6449076
The text inside <script> tags is not ordinary raw text; there are all sorts
of other complications. This CL implements those complications.
Pass 76 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6443070
This is more in sync with the rest of the package;
for instance, we have functions (not methods) to
deref or find the underlying type of a Type.
In the process use a single bytes.Buffer to create
the string representation for a type rather than
the (occasional) string concatenation.
R=r
CC=golang-dev
https://golang.org/cl/6458057
If an end tag has an attribute that is a quoted string containing '>',
the tokenizer would end the tag prematurely. Now it reads the attributes
on end tags just as it does on start tags, but the high-level interface
still doesn't return them, because their presence is a parse error.
Pass 1 additional test.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6457060
The receive operator was given incorrect precedence
resulting in incorrect deletion of parentheses.
Fixes#3843.
R=rsc
CC=golang-dev, remy
https://golang.org/cl/6442049
LLVM-based gcc will place all-zero data in a zero-filled
section, but our debug/macho can't handle that.
Fixes#3821.
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6444049
If the X-Forwarded-For header already exists on a request, we
should append our client's IP to it after a comma+space instead
of overwriting it.
Fixes#3846.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6448053
This syscall was inadvertently exported when fixing
Getrlimit/Setrlimit on 32-bit platforms.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6458051
The situation only affects diagnostics but is easy to fix.
When computing lineNumber, use the position of the last item
returned by nextItem rather than the current state of the lexer.
This is internal only and does not affect the API.
Fixes#3886.
R=golang-dev, iant
CC=golang-dev
https://golang.org/cl/6445061
They were previously ignored when deciding order and
detecting dependency loops.
Fixes#3824.
R=rsc, golang-dev
CC=golang-dev, remy
https://golang.org/cl/6455055
Should probably be fixed in the syscall package, either
additional or instead of this CL.
Fixes#3842
R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/6442061
This fixes a data race (usually just harmlessly updating
"GET" to "GET"), but also follows RFC 2616 Sec 5.1.1 which
says that the request method is case-sensitive.
Fixes#3881
R=golang-dev, rsc, dsymonds
CC=golang-dev
https://golang.org/cl/6446063
Darwin kernels have a bug in accept() where error result from
an internal call is not checked and socket is accepted instead
of ECONNABORTED error. However, such sockets have no sockaddr,
which results in EAFNOSUPPORT error from anyToSockaddr, making
Go http servers running on Mac OS X easily susceptible to
denial of service from simple port scans with nmap.
Fixes#3849.
R=golang-dev, adg, mikioh.mikioh
CC=golang-dev
https://golang.org/cl/6456045
- Allow handles into the trie for different locales. Multiple tables share the same
try to allow for reuse of blocks.
- Significantly improved memory footprint and reduced allocations of trieNodes.
This speeds up generation by about 30% and allows keeping trieNodes around
for multiple locales during generation.
- Renamed print method to fprint.
R=r
CC=golang-dev
https://golang.org/cl/6408052
pkg log already appends a linefeed to the log message,
so log/syslog doesn't need to append another.
R=golang-dev, bradfitz, r
CC=golang-dev
https://golang.org/cl/6441048
When a cgo program calls setuid, setgid, etc., the GNU/Linux
pthread library sends signal SIGSETXID to each thread to tell
it to update its UID info. If Go is permitted to intercept
the default SIGSETXID signal handler, the program will hang.
This patch tells the runtime package to not try to intercept
SIGSETXID on GNU/Linux. This will be odd if a Go program
wants to try to use that signal, but it means that cgo
programs that call setuid, etc., won't hang.
Fixes#3871.
R=rsc, r, minux.ma, bradfitz
CC=golang-dev
https://golang.org/cl/6455050
The go/ast comment for FuncType.Params says that the field may be nil.
Make sure the printer accepts such a value. The go/parser always sets
the field (to provide parenthesis position information), but a program
creating a Go AST from scatch may not.
Added corresponding test case.
Fixes#3870.
R=golang-dev, r
CC=golang-dev
https://golang.org/cl/6448060
If NUL bytes occur inside certain elements, convert them to U+FFFD
replacement character.
Pass 1 additional test.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6452047
Fixed creation of Func's, taking IsVariadic from parameter list rather
than results.
Updated checkObj to process ast.Fun objects.
R=gri
CC=golang-dev
https://golang.org/cl/6402046
Declare crosscall2. Declare the functions passed to it as
returning void, rather than relying on implicit return type.
R=golang-dev, minux.ma
CC=golang-dev
https://golang.org/cl/6432060
If the body of an HTML document contains text, the <frameset> tag is
ignored. But not if the text is only whitespace.
Pass 4 additional tests.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6442043
If the key is not present, return value of the type of the element
not the type of the key. Also fix a test that should have caught this case.
Fixes#3850.
R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/6405078
Add commentary to explain better what's going on, but the
code change is a simple one-line reversal to the previous
form.
R=rsc
CC=golang-dev
https://golang.org/cl/6428072
Don't unescape entities in attributes when they don't end with
a semicolon and they are followed by '=', a letter, or a digit.
Pass 6 more tests from the WebKit test suite, plus one that was
commented out in token_test.go.
R=nigeltao
CC=golang-dev
https://golang.org/cl/6405073
Surrogates are still admitted, but I have sent mail to golang-dev on that topic.
Fixes#3785.
R=golang-dev, rogpeppe, iant
CC=golang-dev
https://golang.org/cl/6398049
If a Client's CheckRedirect function returns an error, we
again return both a non-nil *Response and a non-nil error.
Fixes#3795
R=golang-dev, n13m3y3r
CC=golang-dev
https://golang.org/cl/6429044
By default, all are still run, but a particular test can be
selected with the new flags.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6395053
Some class of bugs (data races, runtime bugs) can be found
only with real parallelism.
Note that GOMAXPROCS=32 is somewhat different from go test -cpu=32,
this intentionally uses GOMAXPROCS to stress program bootstrap,
testing code, garbage collections, etc.
Package selection is mostly random.
R=golang-dev, dave, r
CC=golang-dev
https://golang.org/cl/6346070
They can generate huge amounts of memory, causing failure on
small machines. Also they can be very slow. So slow that one test
was commented out! We uncomment it and use a flag.
Fixes#3742.
R=golang-dev, bradfitz
CC=golang-dev
https://golang.org/cl/6373044