Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions builder/sizes_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -42,9 +42,9 @@ func TestBinarySize(t *testing.T) {
// This is a small number of very diverse targets that we want to test.
tests := []sizeTest{
// microcontrollers
{"hifive1b", "examples/echo", 3817, 299, 0, 2252},
{"microbit", "examples/serial", 2820, 356, 8, 2248},
{"wioterminal", "examples/pininterrupt", 8020, 1652, 132, 7480},
{"hifive1b", "examples/echo", 3925, 299, 0, 2260},
{"microbit", "examples/serial", 2876, 356, 8, 2256},
{"wioterminal", "examples/pininterrupt", 8108, 1652, 132, 7488},

// TODO: also check wasm. Right now this is difficult, because
// wasm binaries are run through wasm-opt and therefore the
Expand Down
5 changes: 5 additions & 0 deletions compiler/asserts.go
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,11 @@ func (b *builder) createChanBoundsCheck(elementSize uint64, bufSize llvm.Value,
// It has no effect in well-behaved programs, but makes sure no uncaught nil
// pointer dereferences exist in valid Go code.
func (b *builder) createNilCheck(inst ssa.Value, ptr llvm.Value, blockPrefix string) {
if b.info.nobounds {
// Function disabled bounds checking - skip nil check.
return
}

// Check whether we need to emit this check at all.
if !ptr.IsAGlobalValue().IsNil() {
return
Expand Down
Loading
Loading