Status: New Owner: ---- Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any Desktop-Any GUI-Any
New issue 210 by emil.len...@gmail.com: For Each corrupts the stack http://code.google.com/p/gambas/issues/detail?id=210 1) Describe the problem. When something stops an enumeration, the stack is very likely to get corrupted. 2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate): Version: TRUNK 3) Provide a little project that reproduces the bug or the crash. Public Sub Main() Dim i As Integer Dim j As Integer Dim e As New Collection For i = 1 To 2 e["hello"] = 1 For Each j In e e.Clear() Next Next End The interpreter crashes with a segmentation fault because the stack is popped when there isn't anything to pop off. I think it can be fixed by moving if (drop || cenum->stop) POP(); to the inside of the if-statement above in gbx_exec_enum.c. ------------------------------------------------------------------------------ Virtualization & Cloud Management Using Capacity Planning Cloud computing makes use of virtualization - but cloud computing also focuses on allowing computing to be delivered as a service. http://www.accelacomm.com/jaw/sfnl/114/51521223/ _______________________________________________ Gambas-user mailing list Gambas-user@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/gambas-user