Ticket #865 (closed defect: fixed)

Opened 4 years ago

Last modified 3 years ago

restart-case mishandles cerror

Reported by: gz Owned by:
Priority: normal Milestone: Clozure CL 1.8
Component: ANSI CL Compliance Version: trunk
Keywords: Cc:

Description

? (defun test (name) (restart-case (cerror "foo ~s" "bar ~s" name)
			  (a-restart () nil)))
TEST
? (test 'hah)
> Error: bar HAH
> While executing: TEST, in process listener(1).
> Type :GO to continue, :POP to abort, :R for a list of available restarts.
> If continued: foo #<error printing object>

Note the #<error printing object>. The problem seems to be restart-case transforming the cerror call and losing its format args in the process.

(pprint (macroexpand-1 '(restart-case (cerror "foo ~s" "bar ~s" name)
			  (a-restart () nil))))

(BLOCK #:G672
  (LET* ((#:G673 (%CONS-RESTART 'A-RESTART NIL NIL NIL NIL))
         (#:G670 (LIST #:G673)))
    (DECLARE (DYNAMIC-EXTENT #:G673 #:G670))
    (CATCH #:G670
      (LET ((%RESTARTS% (CONS #:G670 %RESTARTS%)))
        (DECLARE (DYNAMIC-EXTENT %RESTARTS%))
        (RETURN-FROM #:G672
          (LET ((#:G671
                 (CONDITION-ARG "bar ~s" (LIST NAME) 'SIMPLE-ERROR)))
            (WITH-CONDITION-RESTARTS
              #:G671
              #:G670
              (CERROR "foo ~s" #:G671)))))))

Change History

comment:1 Changed 3 years ago by rme

  • Milestone set to Clozure CL 1.8

comment:2 Changed 3 years ago by gb

  • Status changed from new to closed
  • Resolution set to fixed

(In [15222]) In RESTART-CASE-FORM, don't try to "optimize" (RESTART-CASE (CERROR ...)). Fixes ticket:865.

comment:3 Changed 3 years ago by gb

  • Status changed from closed to reopened
  • Resolution fixed deleted

The alleged fix in r15222 seems to cause a test failure.

comment:4 Changed 3 years ago by gb

  • Status changed from reopened to closed
  • Resolution set to fixed

(In [15223]) Try to fix ticket:865 another way.

Note: See TracTickets for help on using tickets.