[fpc-devel] Can't build FPC what can be a reason?

Paul Ishenin ip at kmiac.ru
Wed Apr 20 09:24:42 CEST 2011


20.04.2011 14:37, Paul Ishenin wrote:
> ENDTOKENS is declared in pbase.pas as
> const
> endtokens = [_SEMICOLON,_END,_ELSE,_UNTIL,_EXCEPT,_FINALLY];
>
> Maybe this happen because ttoken contains > 256 elements and we do
> pbyte(sym.value.valueptr+i)^ ?

My further research:

All tsetdef.size except endtokens have size = 4 or 32. endtokens has 
size = 33.

Compiler uses pconstset for valueptr in case of set.
pconstset = ^set of 0..255 => max size = 32

Therefore for endtokens we go after the end of allocated value_ptr^ and 
of course we get random data there (I suppose in some cases we get 
access violation).

I looked at tsetdef.create for the reason of size = 33 and found the 
next line:
savesize:=(high+7) div 8

Looks like as our case: if high = 257 then savesize = 33.

Best regards,
Paul Ishenin




More information about the fpc-devel mailing list