[Lazarus] SEGFAULT: difference between pointer and dynarray?

xrfang xrfang at gmail.com
Sun Dec 30 12:55:12 CET 2012


Hi leledumbo,

Apparently, I've been wrong for all these years using Delphi :-S.   I always think that open arrays are same as dynamic arrays. So,

1) from the source code of lua52.pas, how do you know the array parameter to luaL_newlib() accepts only static array but not dynamic array?   If you don't read the source code or document of lua API?

2) If the api only accept static array but I passed dynamic array and hence it crashed, then it is my fault, not FPC compilers.   In such case, shall I still file a bug report?

3) Finally, if I still file a bug, can I just ask the reviewer to read this mail thread as it is archived?

Thanks

在 日, 12月 30, 2012 at 7:41 下午,leledumbo <leledumbo_cool at yahoo.co.id> 写道:
> 1) what's the difference between open array and dynamic array? Is "array of 
Integer" open or dynamic? 

Open array can only be declared as parameter type, it can't be declared as a 
variable type. When done in latter case, it will always be dynamic array. 
The following example will explain: 

type 
TDynIntArray = array of Integer; 

procedure p1(a: TDynIntArray); // here a is dynamic array 
procedure p2(a: array of Integer); // here a is open array 

a good article explaining open array: 
http://rvelthuis.de/articles/articles-openarr.html 
so "array of Integer" can mean both, depending where and how it's declared. 

> 2) How to report a bug, and I believe this maybe a bug in the fpc 
> compiler? 

http://wiki.lazarus.freepascal.org/How_do_I_create_a_bug_report 

or just go to bugs.freepascal.org, login (create account if you don't have 
one) and press report issue (the fields are mostly intuitive). 



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

-- 
_______________________________________________ 
Lazarus mailing list 
Lazarus at lists.lazarus.freepascal.org 
http://lists.lazarus.freepascal.org/mailman/listinfo/lazarus 

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lazarus-ide.org/pipermail/lazarus/attachments/20121230/5e602a2c/attachment-0003.html>


More information about the Lazarus mailing list