TailBite specific forum
Moderators: gnozal , ABBKlaus , lexvictory
akee
Enthusiast
Posts: 479 Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia
Post
by akee » Sat Jun 18, 2011 6:53 am
Tailbite 1.4.7 with PB 4.51.
Tailbite First.pb and Second.pb. Then run Third.pb. Seems that the protected variable alpha$ gets shared.
First.pb
Code: Select all
Procedure$ First_Private(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " first"
ProcedureReturn alpha$
EndProcedure
ProcedureDLL$ First(p1$)
ProcedureReturn First_Private(p1$)
EndProcedure
Second.pb
Code: Select all
Procedure$ Seconds_Private(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " second"
ProcedureReturn alpha$
EndProcedure
ProcedureDLL$ Seconds(p1$)
ProcedureReturn Seconds_Private(p1$)
EndProcedure
Third.pb
Code: Select all
Debug First(Seconds("*")) ; * second* second first
Procedure$ InFirst(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " first"
ProcedureReturn alpha$
EndProcedure
Procedure$ InSeconds(p1$)
Protected alpha$ = ""
alpha$ = p1$ + " second"
ProcedureReturn alpha$
EndProcedure
Debug InFirst(InSeconds("*")) ; * second first
ABBKlaus
Addict
Posts: 1143 Joined: Sat Apr 10, 2004 1:20 pm
Location: Germany
Post
by ABBKlaus » Sat Jun 18, 2011 10:19 am
Its a known issue (the first one on the list) and has nothing to do with the protected keyword.
akee
Enthusiast
Posts: 479 Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia
Post
by akee » Sun Jun 19, 2011 9:43 am
Tanks for the feedback ABBKlaus. Do you know if 4.60 fixes this?
akee
Enthusiast
Posts: 479 Joined: Wed Aug 18, 2004 9:52 am
Location: Penang, Malaysia
Post
by akee » Sun Sep 11, 2011 11:06 am
Just retried this example with 4.60 RC1. This bug is not yet fixed...
gnozal
PureBasic Expert
Posts: 4229 Joined: Sat Apr 26, 2003 8:27 am
Location: Strasbourg / France
Contact:
Post
by gnozal » Mon Sep 12, 2011 9:37 am
akee wrote: Just retried this example with 4.60 RC1. This bug is not yet fixed...
It is not a PB bug, as PB libraries work fine.
It's a Tailbite issue (
http://www.purebasic.fr/english/viewtopic.php?p=230189 ) related to the 'double PUSH dword [_PB_StringBasePosition]' in Purebasic.asm when a procedure returns a string.
For free libraries and tools, visit my web site (also home of jaPBe V3 and PureFORM).