Andrew Balholm [Wed, 15 Aug 2012 23:31:22 +0000 (09:31 +1000)]
exp/html: simplify testing code
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.
Joel Sing [Wed, 15 Aug 2012 16:06:21 +0000 (02:06 +1000)]
os/exec: disable additional file descriptor test on netbsd
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.
Andrew Balholm [Wed, 15 Aug 2012 01:44:25 +0000 (11:44 +1000)]
exp/html: skip render and reparse on more tests that build badly-formed parse trees
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).
Andrew Balholm [Mon, 13 Aug 2012 23:53:10 +0000 (09:53 +1000)]
exp/html: generate replacement for <isindex> correctly
When generating replacement elements for an <isindex> tag, the old
addSyntheticElement method was producing the wrong nesting. Replace
it with parseImpliedToken.
Andrew Balholm [Thu, 9 Aug 2012 23:34:10 +0000 (09:34 +1000)]
exp/html: ignore self-closing flag except in SVG and MathML
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.
Rob Pike [Thu, 9 Aug 2012 03:02:19 +0000 (20:02 -0700)]
text/template: add 'nil' as a keyword in the language
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.
Shenghou Ma [Thu, 9 Aug 2012 00:47:43 +0000 (08:47 +0800)]
cmd/5l: add PT_PAX_FLAGS ELF header
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.
Rob Pike [Wed, 8 Aug 2012 21:01:23 +0000 (14:01 -0700)]
all: make Unicode surrogate halves illegal as UTF-8
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.
Robert Griesemer [Wed, 8 Aug 2012 00:45:58 +0000 (17:45 -0700)]
godoc: make id attributes unique
Some browsers (e.g. IE9) ignore the case of 'id' attributes
which can lead to conflicts. Prefix non-generated 'id's with
"pkg-" to make them different from any generated attribute.
Also: Added missing entry for "Other packages" to top-level
index.
Nigel Tao [Tue, 7 Aug 2012 23:57:09 +0000 (09:57 +1000)]
image/jpeg: send a correct Start Of Scan (SOS) header.
Section B.2.3 of http://www.w3.org/Graphics/JPEG/itu-t81.pdf discusses
the End of spectral selection (Se) byte.
Apparently many JPEG decoders ignore the Se byte (or let it through
with a warning), but some configurations reject them. For example,
http://download.blender.org/source/chest/blender_2.03_tree/jpeg/jcmaster.c
has these lines:
if (Ss != 0 || Se != DCTSIZE2-1 || Ah != 0 || Al != 0)
ERREXIT1(cinfo, JERR_BAD_PROG_SCRIPT, scanno);
Shenghou Ma [Tue, 7 Aug 2012 15:45:50 +0000 (23:45 +0800)]
runtime: inline several float64 routines to speed up complex128 division
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
Shenghou Ma [Tue, 7 Aug 2012 01:57:14 +0000 (09:57 +0800)]
math, runtime: use a NaN that matches gcc's
our old choice is not working properly at least on VFPv2 in
ARM1136JF-S (it's not preserved across float64->float32 conversions).
Shenghou Ma [Tue, 7 Aug 2012 01:38:35 +0000 (09:38 +0800)]
misc/cgo/{life,stdio}, test/run.go: use test/run.go to do the cgo tests
Enhances test/run.go to support testing other directories
Will enable stdio tests on Windows in a follow-up CL.
Andrew Balholm [Mon, 6 Aug 2012 23:35:09 +0000 (09:35 +1000)]
exp/html: fix foster-parenting when elements are implicitly closed
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.
Alexey Borzenkov [Sun, 5 Aug 2012 21:24:32 +0000 (17:24 -0400)]
syscall: return EINVAL when string arguments have NUL characters
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.
Russ Cox [Sun, 5 Aug 2012 18:35:35 +0000 (14:35 -0400)]
misc/dashboard/codereview: show first line of last message in thread
This line helps me to tell whether the CL is waiting for me or I'm waiting for the author.
Also:
- vertical-align table cells so buttons are always aligned with CL headers.
- add email= to show front page for someone else.
Demo at http://rsc.gocodereview.appspot.com/.
Until this is deployed for real, some recently changed CLs may be
missing the 'first line of last message' part.
Andrew Balholm [Sun, 5 Aug 2012 12:32:35 +0000 (22:32 +1000)]
exp/html: don't treat SVG <title> like HTML <title>
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.
Dmitriy Vyukov [Sat, 4 Aug 2012 15:02:12 +0000 (18:02 +0300)]
cmd/go: allow to use syso files with cgo
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émy Oudompheng [Fri, 3 Aug 2012 19:47:26 +0000 (21:47 +0200)]
cmd/gc: accept switches on comparable arrays.
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.
Adam Langley [Fri, 3 Aug 2012 17:28:05 +0000 (13:28 -0400)]
crypto/tls: remove flakey tests
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.
Marcel van Lohuizen [Fri, 3 Aug 2012 07:01:21 +0000 (09:01 +0200)]
exp/locale/collate: changed API of Builder to be more convenient
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.
Shenghou Ma [Wed, 1 Aug 2012 03:26:33 +0000 (23:26 -0400)]
test/run.go: fix compiledir test on windows
we can't import "./bug0" on windows, as it will trigger
"import path contains invalid character ':'" error.
instead, we pass "-D." and "-I." to gc to override this
behavior. this idea is due to remyoudompheng.
Andrew Balholm [Tue, 31 Jul 2012 23:35:02 +0000 (09:35 +1000)]
exp/html: tokenize attributes of end tags
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.
Shenghou Ma [Mon, 30 Jul 2012 22:44:48 +0000 (18:44 -0400)]
cmd/cgo: use 1 as last entry for __cgodebug_data
LLVM-based gcc will place all-zero data in a zero-filled
section, but our debug/macho can't handle that.
Fixes #3821.
Rob Pike [Mon, 30 Jul 2012 22:11:20 +0000 (15:11 -0700)]
text/template/parse: fix data race
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.