diff options
author | Ayke van Laethem <[email protected]> | 2018-09-02 16:24:50 +0200 |
---|---|---|
committer | Ayke van Laethem <[email protected]> | 2018-09-02 16:28:46 +0200 |
commit | 88b6b2e7f5a3f513d75efdebf0df872b10b37333 (patch) | |
tree | c7395bf573c761e14ec1f4cbf30a8f43f8bc63cc /src/runtime/runtime.go | |
parent | 42cddd3260893cdfb36a71129aff61980e969c3d (diff) | |
download | tinygo-88b6b2e7f5a3f513d75efdebf0df872b10b37333.tar.gz tinygo-88b6b2e7f5a3f513d75efdebf0df872b10b37333.zip |
Optimize/eliminate bounds checking
TODO: do better at it by tracking min/max values of integers. The
following straightforward code doesn't have its bounds checks removed:
for _, n := range slice {
println(n)
}
Diffstat (limited to 'src/runtime/runtime.go')
-rw-r--r-- | src/runtime/runtime.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/runtime/runtime.go b/src/runtime/runtime.go index 07cf049cb..94b1f270d 100644 --- a/src/runtime/runtime.go +++ b/src/runtime/runtime.go @@ -56,7 +56,7 @@ func _panic(message interface{}) { abort() } -// Check for bounds in *ssa.IndexAddr and *ssa.Lookup. +// Check for bounds in *ssa.Index, *ssa.IndexAddr and *ssa.Lookup. func lookupBoundsCheck(length, index int) { if index < 0 || index >= length { // printstring() here is safe as this function is excluded from bounds |