tinygo/compiler
Ayke van Laethem 0314a487ff
compiler: check slice cap instead of len during slicing
When doing a slice operation on a slice, use the capacity value instead
of the length. Of course, for strings and arrays, the slice operation
checks the length because there is no capacity. But according to the
spec, this check should be based on cap for slice instead of len:

> For slices, the upper index bound is the slice capacity cap(a) rather
> than the length.

https://golang.org/ref/spec#Slice_expressions

Fixes: https://github.com/aykevl/tinygo/issues/65
2018-10-30 15:58:50 +01:00
..
calls.go compiler: implement deferring of immediately-applied closures 2018-10-22 14:06:51 +02:00
compiler.go compiler: check slice cap instead of len during slicing 2018-10-30 15:58:50 +01:00
map.go compiler: support comma-ok in map lookup 2018-10-20 17:54:16 +02:00
optimizer.go compiler: remove println statement 2018-10-29 18:18:23 +01:00
sizes.go compiler: refactor compiler into separate package 2018-09-22 20:32:28 +02:00