[Lazarus] SEGFAULT: difference between pointer and dynarray?

xrfang xrfang at gmail.com
Sat Dec 29 02:18:47 CET 2012


The Assembler shows that @lib and @lib[0] are exactly same thing.   The problem
is in lua52.pas, which I am still tracing.  Now the most strange thing is why one of my two programs caused SIGSEGV while another one using same code block does not?  Is it because one of them is gui program and the other is cli?

I will post a debug report of assembly call points for these 2 programs on both Linux-64 and Win-32 platforms.

Thanks,
Shannon

在 六, 12月 29, 2012 at 12:26 上午,leledumbo <leledumbo_cool at yahoo.co.id> 写道:
Pointer and dynamic array are not the same, even though dynamic array is 
built on top of pointer (to a structure). When you pass a dynamic array 
variable, you're passing pointer TO THE STRUCTURE, NOT THE DATA. To 
correctly do it, you have to pass pointer to the first data, which is 
@lib[0] in your case. 



-- 
View this message in context: http://free-pascal-lazarus.989080.n3.nabble.com/Lazarus-SEGFAULT-difference-between-pointer-and-dynarray-tp4028296p4028297.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/20121229/0d7bf6e5/attachment-0003.html>


More information about the Lazarus mailing list