[Gambas-user] Issue 97 in gambas: Cannot use ByRef on more than 32 parameters

gambas at ...2524... gambas at ...2524...
Mon Sep 5 01:13:23 CEST 2011


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

New issue 97 by emil.len... at ...626...: Cannot use ByRef on more than 32  
parameters
http://code.google.com/p/gambas/issues/detail?id=97

1) Describe the problem.
The interpreter will crash with "error: Internal compiler error: Bad stack  
usage computed!" when using ByRef on a function that takes more than 32  
parameters.

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

Version: TRUNK
Revision: r4086
Operating system: Linux
Architecture: x86_64

3) Provide a little project that reproduces the bug or the crash.

Public Sub Run(a As Variant, b As Variant, c As Variant, d As Variant, e As  
Variant)

   c(ByRef d, b, b, a, b, b, b, b, b, b, b, b, b, b, b, a, b, b, b, b, a, b,  
b, b, b, b, b, b, b, b, b, b, ByRef e)

End

4) If your project needs a database, try to provide it, or part of it.
-

5) Explain clearly how to reproduce the bug or the crash.
Try to compile

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

It seems to be fixed when changing
	for (i = 0; i < nparam; i++)
	{
		if (byref & (1 << i))
			n++;
	}
	use_stack(n);
to
	for (i = 0; i < nparam; i++)
	{
		if (byref & (1ULL << i))
			n++;
	}
	use_stack(n);

in CODE_call_byref in gb_code_temp.h





More information about the User mailing list