VarArrayLock does not work
Original Reporter info from Mantis: Petr-K
-
Reporter name:
Original Reporter info from Mantis: Petr-K
- Reporter name:
Description:
If example compiled with trunk (Linux x86-64) i get:
EAccessViolation: Access violation
$000000000043CB26 SYSVARARRAYPUT, line 2677 of rtl-objpas/src/inc/variants.pp
$000000000041B799 fpc_vararray_put, line 104 of ../inc/variant.inc
$000000000040039D main, line 14 of vararray.pas
$000000000042F925 SYSENTRY_INITTLS, line 333 of system.pp
Compiled with fpc-3.2.0, 3.1.1, or olders works ok.
Steps to reproduce:
uses
Variants;
type
T = array[0..1] of Variant;
var
v: Variant;
P: ^T;
begin
v := VarArrayCreate([0, 1], varVariant);
v[0] := VarArrayCreate([0, 0], varVariant);
v[1] := VarArrayCreate([0, 0], varVariant);
P:=VarArrayLock(v);
P^[0][0] := 'X';
P^[1][0] := 'Y'; //<-Access violation
VarArrayUnlock(v);
writeln(v[0][0]);
writeln(v[1][0]);
end.
Mantis conversion info:
- Mantis ID: 37316
- Build: Revision: 45742
- Version: 3.3.1
- Fixed in revision: 47286 (#d5e20fa6)