It is currently Mon Jan 27, 2020 10:57 am

All times are UTC + 1 hour




Post new topic Reply to topic  [ 6 posts ] 
Author Message
 Post subject: [Done] Static multi-dimensional array in Procedure.
PostPosted: Tue Oct 30, 2018 2:52 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Dec 23, 2009 10:14 pm
Posts: 3183
Location: Boston, MA
Bug found here:
Code:
Procedure MY1()
  Static Dim t1.i(10,10)  ;<-- No bug if Static 1d array declared before 2d array?
  Static Dim t2.i(10)
  ;Protected Dim t1.i(10,10)  ;<-- No bug
  ;Protected Dim t2.i(10)
EndProcedure
MY1()
; [19:12:29] Waiting for executable to start...
; [19:12:29] Executable type: Windows - x64  (64bit, Unicode, Thread, Purifier)
; [19:12:29] Executable started.
; [19:12:29] [ERROR] BUG_562_static-2darray-ima.pb (Line: 1)
; [19:12:29] [ERROR] Invalid memory access. (read error at address 4294967264)

_________________
The nice thing about standards is there are so many to choose from. ~ Andrew Tanenbaum


Top
 Profile  
Reply with quote  
 Post subject: Re: [v562-compiler] Static multi-dimensional array in Proced
PostPosted: Sat Nov 03, 2018 2:31 pm 
Offline
Addict
Addict
User avatar

Joined: Wed Aug 31, 2005 11:09 pm
Posts: 3695
Location: Italy
It seems to happen only on x64 and only with the debugger enabled, so maybe the problem is in the code added by the debugger ?
You don't even need to invoke the procedure.

_________________
[ My little PureBasic review ]


Top
 Profile  
Reply with quote  
 Post subject: Re: [v562-compiler] Static multi-dimensional array in Proced
PostPosted: Fri Dec 20, 2019 2:41 pm 
Offline
User
User

Joined: Mon Nov 11, 2013 11:07 am
Posts: 50
Location: Netherlands
V5.71 LTS. The bug still exists. I get "Invalid memory access. (read error at address 4294967264)" in another project and Google brought me here. I get the read error in both this example and the other project, that uses Static multi dimensional arrays in procedures as well.

Please fix this bug.
Thx


Top
 Profile  
Reply with quote  
 Post subject: Re: [v562-compiler] Static multi-dimensional array in Proced
PostPosted: Fri Dec 20, 2019 2:54 pm 
Offline
User
User

Joined: Mon Nov 11, 2013 11:07 am
Posts: 50
Location: Netherlands
Some sort of workaround, might be usefull:

Code:
Dim t1.i(10,10)
Dim t2.i(10)
 
Procedure MY1(fct.i)
   Shared t1(), t2()
     
   t1(4,4) = 8 * fct
   t2(4) = 3 * fct
   
   Debug t1(4,4)
   Debug t2(4)

EndProcedure

MY1(1)
MY1(2)


Top
 Profile  
Reply with quote  
 Post subject: Re: [v562-compiler] Static multi-dimensional array in Proced
PostPosted: Tue Jan 21, 2020 3:33 pm 
Offline
Administrator
Administrator

Joined: Fri May 17, 2002 4:39 pm
Posts: 13707
Location: France
Fixed.


Top
 Profile  
Reply with quote  
 Post subject: Re: [Done] Static multi-dimensional array in Procedure.
PostPosted: Fri Jan 24, 2020 6:17 pm 
Offline
User
User

Joined: Mon Nov 11, 2013 11:07 am
Posts: 50
Location: Netherlands
Thx!! :D


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 6 posts ] 

All times are UTC + 1 hour


Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum

Search for:
Jump to:  

 


Powered by phpBB © 2008 phpBB Group
subSilver+ theme by Canver Software, sponsor Sanal Modifiye