1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-06-14 15:40:19 +02:00

* Make sure that scm_display_error validates its port argument.

This commit is contained in:
Dirk Herrmann 2001-01-24 15:58:46 +00:00
parent f1e06a96a2
commit e40a4095d6
4 changed files with 34 additions and 5 deletions

View file

@ -219,10 +219,14 @@ display_error_handler (struct display_error_handler_data *data,
return SCM_UNSPECIFIED;
}
SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
(SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
"")
#define FUNC_NAME s_scm_display_error
/* The function scm_i_display_error prints out a detailed error message. This
* function will be called directly within libguile to signal error messages.
* No parameter checks will be performed by scm_i_display_error. Thus, User
* code should rather use the function scm_display_error.
*/
void
scm_i_display_error (SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest)
{
struct display_error_args a;
struct display_error_handler_data data;
@ -237,10 +241,23 @@ SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
scm_internal_catch (SCM_BOOL_T,
(scm_catch_body_t) display_error_body, &a,
(scm_catch_handler_t) display_error_handler, &data);
}
SCM_DEFINE (scm_display_error, "display-error", 6, 0, 0,
(SCM stack, SCM port, SCM subr, SCM message, SCM args, SCM rest),
"")
#define FUNC_NAME s_scm_display_error
{
SCM_VALIDATE_OUTPUT_PORT (2, port);
scm_i_display_error (stack, port, subr, message, args, rest);
return SCM_UNSPECIFIED;
}
#undef FUNC_NAME
typedef struct {
int level;
int length;