neoneo-go/pkg/compiler
Roman Khimov be7527409c compiler: fix panic in notification check
Options is a pointer, so it can be nil:

--- FAIL: TestCompiler (0.23s)
    --- FAIL: TestCompiler/TestCompile (0.21s)
panic: runtime error: invalid memory address or nil pointer dereference [recovered]
        panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x40 pc=0x960374]

goroutine 8861 [running]:
testing.tRunner.func1.2({0xa604c0, 0x112c230})
        /usr/lib64/go/1.18/src/testing/testing.go:1389 +0x24e
testing.tRunner.func1()
        /usr/lib64/go/1.18/src/testing/testing.go:1392 +0x39f
panic({0xa604c0, 0x112c230})
        /usr/lib64/go/1.18/src/runtime/panic.go:838 +0x207
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).processNotify(0xc0000eba40, 0xc000233ae0?, {0xc00044ae90, 0x1, 0x1})
        /home/rik/dev/neo-go/pkg/compiler/inline.go:134 +0xd4
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).processStdlibCall(0xc0000eba40?, 0xc000233ae0, {0xc00044ae90, 0x1, 0x1})
        /home/rik/dev/neo-go/pkg/compiler/inline.go:124 +0xda
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).inlineCall(0xc0000eba40, 0xc000233ae0, 0xc0001fe5c0)
        /home/rik/dev/neo-go/pkg/compiler/inline.go:35 +0x1fa
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).Visit(0xc0000eba40, {0xd36bf8?, 0xc0001fe5c0?})
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:932 +0x152c
go/ast.Walk({0xd348e0?, 0xc0000eba40?}, {0xd36bf8?, 0xc0001fe5c0?})
        /usr/lib64/go/1.18/src/go/ast/walk.go:52 +0x62
go/ast.Walk({0xd348e0?, 0xc0000eba40?}, {0xd36db0?, 0xc00044aeb0?})
        /usr/lib64/go/1.18/src/go/ast/walk.go:207 +0x1154
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).Visit(0xc0000eba40, {0xd36ba8?, 0xc0001cce70?})
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:1155 +0x54cd
go/ast.Walk({0xd348e0?, 0xc0000eba40?}, {0xd36ba8?, 0xc0001cce70?})
        /usr/lib64/go/1.18/src/go/ast/walk.go:52 +0x62
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).Visit(0xc0000eba40, {0xd36f68?, 0xc0001fe600?})
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:733 +0x2e30
go/ast.Walk({0xd348e0?, 0xc0000eba40?}, {0xd36f68?, 0xc0001fe600?})
        /usr/lib64/go/1.18/src/go/ast/walk.go:52 +0x62
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).Visit(0xc0000eba40, {0xd36ba8?, 0xc0001ccea0?})
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:1155 +0x54cd
go/ast.Walk({0xd348e0?, 0xc0000eba40?}, {0xd36ba8?, 0xc0001ccea0?})
        /usr/lib64/go/1.18/src/go/ast/walk.go:52 +0x62
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).convertFuncDecl(0xc0000eba40, {0xd36e28, 0xc000256700}, 0xc0001cced0, 0xc00041b68c?)
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:502 +0x97d
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).compile.func2(0xc000256700, 0xc0001c64b0)
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:2129 +0x1f9
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).ForEachFile.func1(0xc000254a00)
        /home/rik/dev/neo-go/pkg/compiler/compiler.go:102 +0x96
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).ForEachPackage(0xc0000eba40, 0xc0002f3c68)
        /home/rik/dev/neo-go/pkg/compiler/compiler.go:93 +0xdb
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).ForEachFile(0xa1f700?, 0xc000448f90?)
        /home/rik/dev/neo-go/pkg/compiler/compiler.go:99 +0x4d
github.com/nspcc-dev/neo-go/pkg/compiler.(*codegen).compile(0xc0000eba40, 0xc00022c390, 0x1?)
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:2116 +0x3d6
github.com/nspcc-dev/neo-go/pkg/compiler.codeGen(0xc00022c390)
        /home/rik/dev/neo-go/pkg/compiler/codegen.go:2167 +0x373
github.com/nspcc-dev/neo-go/pkg/compiler.CompileWithOptions({0xc000c525a0?, 0x16?}, {0x0?, 0x0?}, 0x0)
        /home/rik/dev/neo-go/pkg/compiler/compiler.go:218 +0x7d
github.com/nspcc-dev/neo-go/pkg/compiler.Compile({0xc000c525a0?, 0xc000304340?}, {0x0?, 0x0?})
        /home/rik/dev/neo-go/pkg/compiler/compiler.go:203 +0x34
github.com/nspcc-dev/neo-go/pkg/compiler_test.compileFile(...)
        /home/rik/dev/neo-go/pkg/compiler/compiler_test.go:89
github.com/nspcc-dev/neo-go/pkg/compiler_test.TestCompiler.func2(0x6a2a89?)
        /home/rik/dev/neo-go/pkg/compiler/compiler_test.go:61 +0x133
testing.tRunner(0xc000304340, 0xc7f5b0)
        /usr/lib64/go/1.18/src/testing/testing.go:1439 +0x102
created by testing.(*T).Run
        /usr/lib64/go/1.18/src/testing/testing.go:1486 +0x35f
2022-03-24 16:34:18 +03:00
..
testdata compiler: set type information during traversal, fix #2231 2021-10-25 13:55:55 +03:00
analysis.go compiler: use full paths for debug info files if relative can't be constructed 2022-02-10 18:58:44 +03:00
assign_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
binary_expr_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
byte_conversion_test.go compiler: allow to convert string constants to []byte 2020-01-27 15:29:52 +03:00
codegen.go compiler: emit bindings configuration 2022-02-28 15:36:14 +03:00
codegen_test.go compiler: allow to use += on strings 2020-08-24 09:44:44 +03:00
compiler.go compiler: revert a part of ad65d1fa1f 2022-03-17 19:39:18 +03:00
compiler_test.go *: remove io/ioutil uses 2022-03-17 19:39:18 +03:00
constant_test.go compiler/interop: replace int64 with int 2021-03-04 13:20:43 +03:00
convert_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
debug.go compiler: emit bindings configuration 2022-02-28 15:36:14 +03:00
debug_test.go compiler: emit bindings configuration 2022-02-28 15:36:14 +03:00
defer_test.go compiler: properly process defer in conditional statements 2022-02-04 11:04:03 +03:00
doc.go *: add more package-specific documentation 2021-03-19 16:18:45 +03:00
for_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
func_scope.go compiler: properly process defer in conditional statements 2022-02-04 11:04:03 +03:00
function_call_test.go compiler: provide .go filename to Compile 2022-01-20 13:21:24 +03:00
global_test.go compiler: allow to use _ in constants 2022-01-20 13:52:58 +03:00
if_test.go compiler: do not DROP unary expression value inside IF stmt 2020-10-13 19:14:44 +03:00
import_test.go vm/emit: emit Boolean values correctly 2021-03-09 13:34:22 +03:00
init_test.go compiler: allow to use local variables in init() 2020-10-06 19:08:32 +03:00
inline.go compiler: fix panic in notification check 2022-03-24 16:34:18 +03:00
inline_test.go compiler: do not traverse defer function literals twice 2022-02-02 16:52:15 +03:00
interop_test.go dao: drop DAO interface 2022-02-16 18:24:20 +03:00
jumps_test.go compiler: process last instructin in writeJumps 2020-08-21 09:43:05 +03:00
lambda_test.go compiler: support calling function literals 2020-08-27 10:28:50 +03:00
limit_test.go compiler: emit integers correctly 2020-01-28 16:39:19 +03:00
map_test.go compiler: support delete() builtin 2020-09-06 15:49:41 +03:00
native_test.go Merge pull request #2382 from nspcc-dev/compiler-optimize 2022-03-04 18:55:40 +03:00
nilcheck_test.go compiler: support nil checks 2020-06-24 10:43:58 +03:00
numeric_test.go compiler: move tests from vm/tests 2019-12-23 17:05:34 +03:00
panic_test.go compiler: do not log panic message 2020-08-27 10:28:50 +03:00
pointer_test.go compiler: copy structs when passing as arguments 2020-08-05 13:14:38 +03:00
return_test.go compiler: do not DROP return value with type assertion 2020-10-13 19:14:44 +03:00
slice_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
struct_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
switch_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
syscall_test.go compiler: group small tests in a single file 2022-03-04 17:55:33 +03:00
type_test.go compiler: support non-struct methods 2020-05-19 16:40:26 +03:00
types.go compiler: update x/tools package 2022-01-20 13:21:26 +03:00
vars.go compiler: allow to use multiple underscores in func arguments 2021-10-09 13:23:11 +03:00
verify_test.go core: rename Neo.Crypto.CheckSig interop 2021-05-11 18:37:55 +03:00
vm_test.go compiler: speed up boolean expression short-circuit test 2022-01-20 13:21:26 +03:00