fix PLT_VALIDATE_COMPILE interaction with 3-D code

Makes the "optimize.rktl" test suite pass when PLT_VALIDATE_COMPILE
is defined.
This commit is contained in:
Matthew Flatt 2014-02-24 08:47:21 -07:00
parent 84b4294345
commit 46523d307b

View File

@ -1992,7 +1992,11 @@ static int validate_expr(Mz_CPort *port, Scheme_Object *expr,
Such a closure can refer back to itself, so we use a flag Such a closure can refer back to itself, so we use a flag
to track cycles. Also check need_local_type. */ to track cycles. Also check need_local_type. */
result = validate_join_const(result, expected_results); result = validate_join_const(result, expected_results);
if (SAME_TYPE(type, scheme_closure_type)) { if (SAME_TYPE(type, scheme_closure_type)
/* If the closure is not empty, then it must be from 3-D code
(where PLT_VALIDATE_COMPILE is set), and validation is not
our responsibility here: */
&& (SCHEME_COMPILED_CLOS_CODE(expr)->closure_size == 0)) {
Scheme_Closure_Data *data; Scheme_Closure_Data *data;
no_typed(need_local_type, port); no_typed(need_local_type, port);
expr = (Scheme_Object *)SCHEME_COMPILED_CLOS_CODE(expr); expr = (Scheme_Object *)SCHEME_COMPILED_CLOS_CODE(expr);