MtnViewJohn/context-free

Bad syntax for functions causes windows client crash

Closed this issue · 2 comments

If the user puts an expression between a function name and the parenthesis for the parameters the context free windows client will crash to desktop when rendering. The effect will persist if the program is opened again when the initial render is performed - so it will crash every time the file is opened.

Here is a demo context free file that causes the crash

startshape CRASH []

foo (n) = n+5

shape CRASH
{
	SQUARE[]
	SQUARE [x foo(1)]
	
	SQUARE [x foo 10+(1)]
}

The 'x foo 10+(1)' causes a crash - the system should generate a compiler error.

Thanks for the information. This crash doesn't happen in the HEAD revision. Denis Kasak did fuzzing tests on Context Free and found many crashes where weird input caused the compiler to be a weird state. I have gone over the compiler with the idea of assuming nothing and checking everything.

Context Free 3.1 will be out soon with these crash fixes and more. I'm waiting for Scintilla (code editor widget) to fix their layout issue with macos Mojave.

Alright thanks :)