albertodemichelis / squirrel

Official repository for the programming language Squirrel
http://www.squirrel-lang.org
MIT License
913 stars 156 forks source link

Sqirrel compiler crashes on these one-liners #255

Closed imp5imp5 closed 1 year ago

imp5imp5 commented 2 years ago

--base Assertion failed: npos < _vlocals.size(), file D:\src\squirrel\squirrel\sqfuncstate.cpp, line 291

delete base Assertion failed: npos < _vlocals.size(), file D:\src\squirrel\squirrel\sqfuncstate.cpp, line 291

x-- = 1 Assertion failed: npos < _vlocals.size(), file D:\src\squirrel\squirrel\sqfuncstate.cpp, line 291

local x; @() !x = 1 Exception thrown: read access violation. sqvector<__int64>::back(...) returned 0xFFFFFFFFFFFFFFF8

DaVieS007 commented 2 years ago

very well, seems valid.

albertodemichelis commented 2 years ago

I'm looking into those, thank you.

teroalatalo commented 1 year ago

Maybe this relates to one of the cases @imp5imp5 already posted, but this piece of code results in the same assertion failed (npos < _vlocals.size(), file sqfuncstate.cpp, line 291) when compiled:

local test = 0; function Foo(f) { if (sin(0) == test += f;

(We're using an embedded Squirrel code editor in our game engine, and it auto-compiles the code every time the user stops writing. That assert keeps popping up occasionally when it's compiling incomplete code.)

albertodemichelis commented 1 year ago

Fixed, thanks to @VasiliyRyabtsev for some of the fixes.

teroalatalo commented 1 year ago

The crash issue when compiling strings like local test; function Foo(f) { 3 == test += 2; still persist after these fixes.

VasiliyRyabtsev commented 1 year ago

The crash issue when compiling strings like local test; function Foo(f) { 3 == test += 2; still persist after these fixes.

This is fixed in https://github.com/GaijinEntertainment/quirrel/commit/ffb290cc8e4f9349497f458a444f5767b47329ec Unfortunately it is not that easy to backport this to original Squirrel