compiler icon indicating copy to clipboard operation
compiler copied to clipboard

Native functions returning arrays and reparsing crash

Open IS4Code opened this issue 6 years ago • 1 comments

Function stubs (native functions) that explicitly return an array don't seem to be handled well by the compiler. First, there are two asserts that fail when such a function is declared:

sc2.c:3265
sc3.c:2007

In case of such a function, a global array is created with the same name as the function. The first assert fails because curfunc is not defined when the function has no body (in funcstub), and the second one fails because the additional variable is defined as iARRAY, while it should be iREFARRAY. Both these asserts fail when such a function is defined or called.

In addition to this, when a reparse is caused, the variable is (apparently) incorrectly deleted, resulting in a crash in delete_symbols. I haven't been able to find the issue, but perhaps this code is incorrect.

IS4Code avatar Oct 19 '19 21:10 IS4Code