ditrit/OGrEE-CLI

CLI crash on wrong separator syntax

Closed this issue · 2 comments

With windows build, the CLI crashes if the separator syntax is wrong:

DEMO.NSQSI.NSQBD.NSQRO:separator=[1.2,10.2]@[9,10.2]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x10e914d]

goroutine 1 [running]:
main.parseSeparators({0xc000010420, 0x20}, {0x114ab40?, 0xc000096390}, {0x114ab40?, 0xc0000963a8}, 0x0?)
        /OGrEE/OGrEE-CLI/ast.go:1644 +0x6d
main.(*specialUpdateNode).execute(0xc00006a190)
        /OGrEE/OGrEE-CLI/ast.go:586 +0x253
main.(*ast).execute(0xc000096378)
        /OGrEE/OGrEE-CLI/ast.go:42 +0x62
main.InterpretLine(0x1248340?)
        /OGrEE/OGrEE-CLI/repl.go:30 +0xc2
main.ExecuteFile(0xc0001df580, {0xc000354100, 0x37})
        /OGrEE/OGrEE-CLI/ocli.go:46 +0x1a5
main.LoadFile({0xc000354100, 0x37})
        /OGrEE/OGrEE-CLI/ocli.go:89 +0x258
main.ExecuteFile(0xc0001df758, {0xc0000c4a40, 0x31})
        /OGrEE/OGrEE-CLI/ocli.go:52 +0x1f1
main.LoadFile({0xc0000c4a40, 0x31})
        /OGrEE/OGrEE-CLI/ocli.go:89 +0x258
main.ExecuteFile(0xc0001df930, {0xc00029a8c0, 0x3a})
        /OGrEE/OGrEE-CLI/ocli.go:52 +0x1f1
main.LoadFile({0xc00029a8c0, 0x3a})
        /OGrEE/OGrEE-CLI/ocli.go:89 +0x258
main.Repl(0xc0000040d8, {0xc0000aae10, 0x5})
        /OGrEE/OGrEE-CLI/repl.go:111 +0x185
main.Start(0xc0000cdee8)
        /OGrEE/OGrEE-CLI/repl.go:102 +0x7cd
main.main()
        /OGrEE/OGrEE-CLI/main.go:92 +0xe70

Appends in lastest master build

BUILD TREE: master
BUILD HASH: 9e0e21827369e64697e741efceac2a8870a48b89
COMMIT DATE:  2022-12-28/11:33:16/-0500

Same thing with incomplete pillar:

asher@OGrEE3D:/Physical$> DEMO.ALPHA.A.R0_WS:pillar=[1.5,1.5]@[1,1]
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xc0000005 code=0x0 addr=0x18 pc=0x10e9a4d]

goroutine 1 [running]:
main.parsePillars({0xc00049a2a0, 0x1c}, {0x114ab40?, 0xc0002101f8}, {0x114ab40?, 0xc000210210}, 0x0?)
        /OGrEE/OGrEE-CLI/ast.go:1722 +0x6d
main.(*specialUpdateNode).execute(0xc000092050)
        /OGrEE/OGrEE-CLI/ast.go:595 +0x2f1
main.(*ast).execute(0xc0002101e0)
        /OGrEE/OGrEE-CLI/ast.go:42 +0x62
main.InterpretLine(0xc000266000?)
        /OGrEE/OGrEE-CLI/repl.go:30 +0xc2
main.Repl(0xc0002100c0, {0xc00000ae50, 0x5})
        /OGrEE/OGrEE-CLI/repl.go:118 +0x1af
main.Start(0xc00011bee8)
        /OGrEE/OGrEE-CLI/repl.go:102 +0x7cd
main.main()
        /OGrEE/OGrEE-CLI/main.go:92 +0xe70

Both pillars and separators are fixed as of 5592906