=================================================================== RCS file: /home/cvs/OpenXM_contrib2/asir2000/io/ox_asir.c,v retrieving revision 1.7 retrieving revision 1.10 diff -u -p -r1.7 -r1.10 --- OpenXM_contrib2/asir2000/io/ox_asir.c 2000/02/09 00:37:21 1.7 +++ OpenXM_contrib2/asir2000/io/ox_asir.c 2000/03/16 01:07:00 1.10 @@ -1,4 +1,4 @@ -/* $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.6 2000/02/08 04:47:11 noro Exp $ */ +/* $OpenXM: OpenXM_contrib2/asir2000/io/ox_asir.c,v 1.9 2000/03/10 06:42:23 noro Exp $ */ #include "ca.h" #include "parse.h" #include "signal.h" @@ -704,6 +704,10 @@ int asir_ox_pop_cmo(void *cmo, int limit) int len; obj = asir_pop_one(); + if ( !valid_as_cmo(obj) ) { + fprintf(stderr,"The object at the stack top is invalid as a CMO.\n"); + return -1; + } len = count_as_cmo(obj); if ( len <= limit ) { ox_copy_init(cmo); @@ -739,10 +743,19 @@ void asir_ox_push_cmd(unsigned int cmd) void asir_ox_execute_string(char *s) { STRING str; + int ret; + ERR err; + extern char LastError[]; MKSTR(str,s); asir_push_one((Obj)str); - asir_executeString(); + if ( ret = setjmp(env) ) { + if ( ret == 1 ) { + create_error(&err,0,LastError); /* XXX */ + asir_push_one((Obj)err); + } + } else + asir_executeString(); } /* @@ -756,6 +769,10 @@ int asir_ox_peek_cmo_size() int len; obj = asir_pop_one(); + if ( !valid_as_cmo(obj) ) { + fprintf(stderr,"The object at the stack top is invalid as a CMO.\n"); + return 0; + } len = count_as_cmo(obj); asir_push_one(obj); return len; @@ -782,7 +799,7 @@ void asir_ox_init(int byteorder) FILE *ifp; #if !defined(VISUAL) && !MPI - do_server_in_X11 = 1; /* XXX */ + do_server_in_X11 = 0; /* XXX */ #endif asir_save_handler(); #if PARI