[Gambas-user] Issue 136 in gambas: Cannot create inline array of Classes - Segmentation fault

gambas at ...2524... gambas at ...2524...
Sat Oct 29 23:50:06 CEST 2011


Status: New
Owner: ----
Labels: Version Type-Bug Priority-Medium OpSys-Any Dist-Any Arch-Any  
Desktop-Any GUI-Any

New issue 136 by emil.len... at ...626...: Cannot create inline array of  
Classes - Segmentation fault
http://code.google.com/p/gambas/issues/detail?id=136

1) Describe the problem.
Cannot create inline array of Classes, i.e. something that is T_CLASS.

2) GIVE THE FOLLOWING INFORMATIONS (if they are appropriate):

Version: TRUNK
Revision: r4223

3) Provide a little project that reproduces the bug or the crash.
Let's say you have a class called Class1 in the project.
When you try to make an inline array containing Class1, the interpreter  
exits with a Segmentation fault.
Try this code:
Dim a As Object
a = [Class1]
or
Dim a As Class[]
a = [Class1]


6) By doing that carefully, you have done 50% of the bug fix job!

Look at the function CARRAY_get_array_class in gbx_c_array.c.
It has a switch depending on the type. The problem is that T_CLASS and  
TC_STRUCT has the same value, and it accidently mistakes the class for a  
struct instance.





More information about the User mailing list