[Lazarus] SEGFAULT: difference between pointer and dynarray?

Egor Skriptunoff egor.skriptunoff at gmail.com
Sat Mar 1 02:01:00 CET 2014


Xiangrong Fang wrote
> The end of array mark is added by lua52.pas, if you read the source
> code...  
> 
> 在 六, 12月 29, 2012 at 9:39 下午,leledumbo <

> leledumbo_cool at .co

> > 写道:
> Reading luaL_newlib documentation and lua52.pas implementation of it (it's
> a 
> macro in the original C code), I see that you need a sentinel value to
> mark 
> the end of the array by putting nil in the name part.

lua52.pas does not append a sentinel for you.  You must do it yourself.
Forgetting to append a sentinel will lead to unpredictable behavior of Lua
internals.

Inside API functions in lua52.pas *@lr* is always equal to *@lr[0]* because
*lr* is an open array parameter.



--
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-SEGFAULT-difference-between-pointer-and-dynarray-tp4028296p4036026.html
Sent from the Free Pascal - Lazarus mailing list archive at Nabble.com.




More information about the Lazarus mailing list