Discussion:
Error: Data element too large / Compilation aborted .. unhandled exception .. AV
(too old to reply)
Hans-Peter Suter
2017-03-15 21:36:53 UTC
Permalink
Raw Message
Goedenavond,

The following snippet gives the above mentioned error message on Mac
(Yosem.) and aborts the compilation process on Ubuntu (14.04). I'm
using version 3.0.2 [2017/02/12] for i386 and 3.0.2 [2017/02/25] for
x86_64. There are several variants (mentioned in code) which influence the
outcome. Code is from a low-level header file which I likely won't ever
need but I thought it might be of interest nevertheless.

Hans-Peter

PS: in case this should go to Tracker/Mantis? could this do someone, maybe?
(otherwise let me know, thanks).

```pascal (file saved as a.pas)
{$MODE DELPHI} // (1) _NOT_ using delphi mode works
unit a;

{==============================================================================}
interface

type
pSExp = pointer;
aSExpArr = array[0..((MaxInt div SizeOf(pSExp)) - 1)] of pSExp;
// aSExpArr = array[0..((MaxInt div 2*SizeOf(pSExp)) - 1)] of pSExp;
// (2) using a _shorter_ array, eg. ^^ works on Ubuntu (Mac still Error)

pFoo = ^aFoo;
aFoo = record
rec: aSExpArr;
end;

function ahoppla(_x: pFoo): aSExpArr;

{==============================================================================}
implementation

type
pData = ^aData;
aData = record
offset: array[1..24] of byte; // (3) uncommenting offset works
SExpArr: aSExpArr;
end;

function ahoppla(_x: pFoo): aSExpArr;
begin
ahoppla:= pData(_x)^.SExpArr;
// ahoppla:= _x.rec; // (4) _not_ casting works on Ubuntu
(Mac error)
end;

end {a}.
```
Florian Klämpfl
2017-03-26 09:38:16 UTC
Permalink
Raw Message
Post by Hans-Peter Suter
Goedenavond,
The following snippet gives the above mentioned error message
The error message for a 32 bit target is correct, the data structure is too big.
Post by Hans-Peter Suter
on Mac (Yosem.) and aborts the
compilation process on Ubuntu (14.04).
Indeed, the compiler crashed for 64 bit targets, fixed.

_______________________________________________
fpc-devel maillist - fpc-***@lists.freepascal.org
http://l

Loading...