Bug Report 2001/08/25-v1.0b25-br01

[forum ]
[Win98 Setup Bug]
Bug Report id=2001/08/25-v1.0b25-br01
Affected versions:v1.0b25 all variations

Bug Description

The following example:
sub test(a)
 undef q
 print a
end sub
q[1] = 1
test q[1]

Causes memory fault.

Bug Reason, What Causes the Bug

When ScriptBasic passes global variables to function it creates a reference variable that references the original variable. This means that changing or accessing the argument changes or accesses the global variable. In the example the argument a is the same as q[1]. When the subroutine undefines the array of which the first element in the example is passed to the function by value the argument variable a still references the original location of q[1] which is at this time is already released and is not a valid memory location.


There is no other solution than to wait for the next available release. The bug correction requires deep reorganization of ScriptBasic internal variable handling.

Bug Workaround Until Solution is Available

Do not undef any global variable in functions.



This page was generated January 28, 2010 9:58:41