﻿id	summary	reporter	owner	description	type	status	priority	milestone	component	version	resolution	keywords	cc	difficulty
1839	incorrect compilation of known local calls	felix winkelmann		"Locally bound known procedures are marked during closure conversion as ""customizable"" when all call sites are known which allows passing arguments directly instead of using the argc/argvector convention. The compiler does this marking on the first encounter of a call to such a procedure with matches the signature. But if a later call does not match the lambda-list the mark is still active, even though that later call uses the standard convention and the callee will be compiled with a customizable arglist. This means that the later call uses the wrong calling convention resulting in a crash.

Here an example:
{{{
(define (foo x)
  (define (bar x y)
    (let ((k (identity bar)))
      (k 1))
    (if (> x 1) (bar (sub1 x) y)))
  (bar 2 x))
(foo '(a b))
}}}

This bug was detected in 6.0.0 but seems already to be present in earlier 5.x.x releases.

A remedy would be to drop the mark when not all call sites have arguments that match the lambda list of the callee."	defect	closed	major	someday	compiler	6.0.0	fixed	optimizer		medium
