A single *ssa.BasicBlock may be split in multiple LLVM basic blocks due
to typeassert instructions. This means the incoming block and outgoing
block are different. PHI nodes need to get the result from the outgoing
block, which was fixed before, but incoming branches need to branch to
the incoming block, not the outgoing block.
Branching to the outgoing block led to a LLVM verification error when
compiling the fmt package.
Originally found in (*fmt.pp).handleMethods.
This is a common operation:
freevar := ...
defer func() {
println("I am deferred:", freevar)
}()
The function is thus an immediately applied closure. Only this form is
currently supported, support for regular (fat) function pointers should
be trivial to add but is not currently implemented as it wasn't
necessary to get fmt to compile.
The Dockerfile was missing the part where we download
the dependencies into the vendor folder. It was of course
working locally because I had a vendor folder already.
A function on a type that is put in an interface must not be assumed to
not need a context pointer when it isn't directly put in a function
pointer, because the interface call side won't know this and pass an
extra parameter with that extra function pointer.
This is usually not a problem but WebAssembly has strict checks on
function signatures so this resulted in an error when running
src/examples/test/test.go.
It is allowed to index with an int64 even on a 32-bit platform, so we
have to handle that case. But make sure the normal case isn't penalized
by using 32-bit numbers when possible.
Bigger hashmaps (size > 8) use multiple buckets in a chain. The lookup
code looked at multiple buckets for a lookup, but kept checking the
first bucket for key equality.
Static map generation used the last bucket instead of the first bucket
in the chain, which caused lots of missing entries in hashmaps with
multiple buckets (size > 8).