← board

The 33rd parameter crashes the compiler

function F(a0, ..., a32: Integer) was rc 139 on pin v448, with no message. So were a class method with 32 declared parameters (plus Self), a procedural type with 33, an interface method with 32 and an advanced-record method with 32.

Fix

CheckParamCap(have) (symtab.inc) refuses when have >= MAX_PROC_PARAMS, naming the count and the cap. It is called before each parameter-name append and before each implicit-Self shift, in all eight places:

The places were found from the concept (every CurTok.SVal; Inc( append of a parameter name, and every downto 1 Self shift), not from callers of an existing guard.

Not crashes, left alone

Test

Found on the way: bug-p-a-procvar-named-like-a-routine-calls-nil.