[Gambas-user] Gambas has Gosub now!

Emil Lenngren emil.lenngren at ...626...
Sun Aug 5 18:33:55 CEST 2012


If there is a pending gosub + a catch, the gosub things on the stack are
erased, so when returning back, invalid values are copied from the stack.

So at stack unwinding, the gosub slots must be kept.

This crashes the interpreter now (or puts it in an infinite loop):

Public Sub Main()

  Dim i As Integer
  With [1]
    For i = 1 To 2
      GoSub lbl
    Next
  End With

  Return

  lbl:
  Error.Raise("Hello")

  Catch
    Print "catching";; Error.Text
    Return

End

2012/7/23 Benoît Minisini <gambas at ...1...>

> Le 23/07/2012 01:14, Emil Lenngren a écrit :
> > It was this line I was worried about:
> > while (SP > (BP + FP->n_local + FP->n_ctrl))
> >
> > /Emil
> >
>
> I think it's ok... Failing during a Gosub is not different from failing
> inside a deep expression evaluation.
>
> --
> Benoît Minisini
>
>
> ------------------------------------------------------------------------------
> Live Security Virtual Conference
> Exclusive live event will cover all the ways today's security and
> threat landscape has changed and how IT managers can respond. Discussions
> will include endpoint security, mobile security and the latest in malware
> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
> _______________________________________________
> Gambas-user mailing list
> Gambas-user at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/gambas-user
>



More information about the User mailing list