diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-03-13 09:15:46 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2000-03-13 09:15:46 +0000 |
commit | 844e89897c44a6c3486b27497e3df015e42813cf (patch) | |
tree | 97b96ee9153d244b65645ecb6547676c8e87e36d | |
parent | 13adec97c9c4ad2aa8ea3edfd9c65710b703f51f (diff) |
2000-03-13
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_4@639 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | ChangeLog | 28 | ||||
-rw-r--r-- | MANIFEST | 7 | ||||
-rw-r--r-- | configure | 5 | ||||
-rw-r--r-- | configure.in | 3 | ||||
-rw-r--r-- | eval.c | 68 | ||||
-rw-r--r-- | gc.c | 6 | ||||
-rw-r--r-- | instruby.rb | 39 | ||||
-rw-r--r-- | node.h | 2 | ||||
-rw-r--r-- | parse.y | 6 | ||||
-rw-r--r-- | process.c | 4 | ||||
-rw-r--r-- | version.h | 4 | ||||
-rw-r--r-- | win32/ruby.def | 5 |
12 files changed, 116 insertions, 61 deletions
@@ -1,3 +1,31 @@ +Mon Mar 13 18:14:52 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * stable version 1.4.4 released. + +Mon Mar 13 16:12:13 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * eval.c (block_pass): distinguish real orphan block and still + on-stack block passed by block argument. + +Mon Mar 13 00:20:25 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * parse.y (f_norm_arg): proper error message when constant comes + in formal argument list. this message is suggested by Muvaw + Pnazte <bugathlon@yahoo.com>. + + * eval.c (rb_f_raise): proper error message when the first + argument is not an exception class/object. + +Sat Mar 11 22:03:03 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * eval.c (rb_f_missing): check if argv[0] is ID. + +Sat Mar 11 05:07:11 2000 Yukihiro Matsumoto <matz@netlab.co.jp> + + * process.c (proc_setpriority): should return 0, not nil. + + * process.c (proc_setpgid): ditto. + Thu Mar 9 11:13:32 2000 Yukihiro Matsumoto <matz@netlab.co.jp> * regex.c (re_compile_fastmap): fixed embarrassing brace bug. @@ -75,6 +75,7 @@ util.c variable.c version.c version.h +beos/GNUmakefile.in cygwin/GNUmakefile.in ext/Setup ext/Setup.dj @@ -125,6 +126,8 @@ lib/matrix.rb lib/mkmf.rb lib/monitor.rb lib/mutex_m.rb +lib/net/ftp.rb +lib/net/http.rb lib/net/pop.rb lib/net/session.rb lib/net/smtp.rb @@ -160,8 +163,6 @@ missing/dup2.c missing/file.h missing/finite.c missing/flock.c -missing/fnmatch.c -missing/fnmatch.h missing/isinf.c missing/isnan.c missing/memcmp.c @@ -235,8 +236,6 @@ win32/config.h win32/config.status win32/ntsetup.bat win32/ruby.def -win32/sdbm.c -win32/sdbm.h win32/win32.c win32/win32.h x68/fconvert.c @@ -2541,7 +2541,7 @@ else #include "confdefs.h" #include <alloca.h> int main() { -char *p = alloca(2 * sizeof(int)); +void *p = alloca(2 * sizeof(int)); ; return 0; } EOF if { (eval echo configure:2548: \"$ac_link\") 1>&5; (eval $ac_link) 2>&5; } && test -s conftest${ac_exeext}; then @@ -4549,6 +4549,7 @@ if test "$fat_binary" = yes ; then CFLAGS="$CFLAGS $ARCH_FLAG" fi +FIRSTMAKEFILE="" LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a' LIBRUBY='$(LIBRUBY_A)' LIBRUBYARG='$(LIBRUBY_A)' @@ -4565,6 +4566,7 @@ if test "$host_os" = "beos"; then ;; i586*) LDFLAGS="$LDFLAGS -L." + FIRSTMAKEFILE=GNUmakefile:beos/GNUmakefile.in ;; *) echo EXPORTS > ruby.def @@ -4573,7 +4575,6 @@ if test "$host_os" = "beos"; then esac fi -FIRSTMAKEFILE="" LIBRUBY_LDSHARED=$LDSHARED LIBRUBY_DLDFLAGS=$DLDFLAGS LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)' diff --git a/configure.in b/configure.in index 6bf1ba6931..2d7157340a 100644 --- a/configure.in +++ b/configure.in @@ -648,6 +648,7 @@ if test "$fat_binary" = yes ; then CFLAGS="$CFLAGS $ARCH_FLAG" fi +FIRSTMAKEFILE="" LIBRUBY_A='lib$(RUBY_INSTALL_NAME).a' LIBRUBY='$(LIBRUBY_A)' LIBRUBYARG='$(LIBRUBY_A)' @@ -664,6 +665,7 @@ if test "$host_os" = "beos"; then ;; i586*) LDFLAGS="$LDFLAGS -L." + FIRSTMAKEFILE=GNUmakefile:beos/GNUmakefile.in ;; *) echo EXPORTS > ruby.def @@ -672,7 +674,6 @@ if test "$host_os" = "beos"; then esac fi -FIRSTMAKEFILE="" LIBRUBY_LDSHARED=$LDSHARED LIBRUBY_DLDFLAGS=$DLDFLAGS LIBRUBY_SO='lib$(RUBY_INSTALL_NAME).so.$(MAJOR).$(MINOR).$(TEENY)' @@ -3135,6 +3135,8 @@ rb_f_raise(argc, argv) VALUE *argv; { VALUE mesg; + ID exception; + int n; mesg = Qnil; switch (argc) { @@ -3147,17 +3149,24 @@ rb_f_raise(argc, argv) mesg = rb_exc_new3(rb_eRuntimeError, argv[0]); break; } - mesg = rb_funcall(argv[0], rb_intern("exception"), 0, 0); - break; - case 3: + n = 0; + goto exception_call; + case 2: - mesg = rb_funcall(argv[0], rb_intern("exception"), 1, argv[1]); + case 3: + n = 1; + exception_call: + exception = rb_intern("exception"); + if (!rb_respond_to(argv[0], exception)) { + rb_raise(rb_eTypeError, "exception class/object expected"); + } + mesg = rb_funcall(argv[0], exception, n, argv[1]); break; default: rb_raise(rb_eArgError, "wrong # of arguments"); break; } - if (!NIL_P(mesg)) { + if (argc > 0) { if (!rb_obj_is_kind_of(mesg, rb_eException)) rb_raise(rb_eTypeError, "exception object expected"); set_backtrace(mesg, (argc>2)?argv[2]:Qnil); @@ -3617,12 +3626,13 @@ rb_f_missing(argc, argv, obj) volatile VALUE d = 0; char *format = 0; char *desc = ""; + const char *mname; char *file = ruby_sourcefile; int line = ruby_sourceline; - if (argc == 0) rb_raise(rb_eArgError, "no id given"); - - id = NUM2INT(argv[0]); + if (argc == 0 || (id = NUM2INT(argv[0]), mname = rb_id2name(id)) == 0) { + rb_raise(rb_eArgError, "no id given"); + } argc--; argv++; switch (TYPE(obj)) { @@ -3650,8 +3660,6 @@ rb_f_missing(argc, argv, obj) format = "protected method `%s' called for %s%s%s"; } else if (last_call_status & CSTAT_VCALL) { - const char *mname = rb_id2name(id); - if (('a' <= mname[0] && mname[0] <= 'z') || mname[0] == '_') { format = "undefined local variable or method `%s' for %s%s%s"; } @@ -3670,7 +3678,7 @@ rb_f_missing(argc, argv, obj) PUSH_FRAME(); /* fake frame */ *ruby_frame = *_frame.prev->prev; - rb_raise(rb_eNameError, format, rb_id2name(id), + rb_raise(rb_eNameError, format, mname, desc, desc[0]=='#'?"":":", desc[0]=='#'?"":rb_class2name(CLASS_OF(obj))); POP_FRAME(); @@ -5818,25 +5826,35 @@ block_pass(self, node) POP_TAG(); POP_ITER(); if (_block.tag->dst == state) { - state &= TAG_MASK; - orphan = 2; + if (orphan) { + state &= TAG_MASK; + } + else { + struct BLOCK *ptr = old_block; + + while (ptr) { + if (ptr->scope == _block.scope) { + ptr->tag->dst = state; + break; + } + ptr = ptr->prev; + } + } } ruby_block = old_block; safe_level = safe; if (state) { - if (orphan == 2) {/* escape from orphan procedure */ - switch (state) { - case TAG_BREAK: - rb_raise(rb_eLocalJumpError, "break from proc-closure"); - break; - case TAG_RETRY: - rb_raise(rb_eLocalJumpError, "retry from proc-closure"); - break; - case TAG_RETURN: - rb_raise(rb_eLocalJumpError, "return from proc-closure"); - break; - } + switch (state) { + case TAG_BREAK: + rb_raise(rb_eLocalJumpError, "break from proc-closure"); + break; + case TAG_RETRY: + rb_raise(rb_eLocalJumpError, "retry from proc-closure"); + break; + case TAG_RETURN: + rb_raise(rb_eLocalJumpError, "return from proc-closure"); + break; } JUMP_TAG(state); } @@ -50,7 +50,6 @@ static unsigned long malloc_memories = 0; static unsigned long alloc_objects = 0; static int malloc_called = 0; -static int free_called = 0; #ifndef xmalloc void * @@ -115,12 +114,11 @@ xrealloc(ptr, size) return mem; } -static void +void xfree(x) void *x; { - free_called++; - free(x); + if (x) free(x); } #endif diff --git a/instruby.rb b/instruby.rb index 52c7c2397f..3222f72194 100644 --- a/instruby.rb +++ b/instruby.rb @@ -15,12 +15,17 @@ if ENV["prefix"] else prefix = CONFIG["prefix"] end + ruby_install_name = CONFIG["ruby_install_name"] +version = "/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"] +arch = "/"+CONFIG["arch"] + bindir = destdir+CONFIG["bindir"] libdir = destdir+CONFIG["libdir"] -#pkglibdir = libdir + "/" + ruby_install_name+"/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"] -pkglibdir = libdir + "/ruby/"+CONFIG["MAJOR"]+"."+CONFIG["MINOR"] -archdir = pkglibdir + "/" + CONFIG["arch"] +rubylibdir = destdir+CONFIG["prefix"]+"/lib/ruby"+version +archlibdir = rubylibdir+arch +sitelibdir = destdir+CONFIG["prefix"]+"/lib/site_ruby"+version +sitearchlibdir = sitelibdir+arch mandir = destdir+CONFIG["mandir"] + "/man1" wdir = Dir.getwd @@ -47,17 +52,17 @@ if File.exist? CONFIG["LIBRUBY_SO"] end end Dir.chdir wdir -File.makedirs pkglibdir, true -File.makedirs archdir, true -File.makedirs pkglibdir+"/site_ruby", true -File.makedirs pkglibdir+"/site_ruby/"+CONFIG["arch"], true +File.makedirs rubylibdir, true +File.makedirs archlibdir, true +File.makedirs sitelibdir, true +File.makedirs sitearchlibdir, true if RUBY_PLATFORM =~ /cygwin/ and File.exist? "import.h" - File.install "import.h", archdir, 0644, true + File.install "import.h", archlibdir, 0644, true end if RUBY_PLATFORM =~ /-aix/ - File.install "ruby.imp", archdir, 0644, true + File.install "ruby.imp", archlibdir, 0644, true end Dir.chdir "ext" @@ -66,26 +71,26 @@ Dir.chdir CONFIG["srcdir"] Find.find("lib") do |f| next unless /\.rb$/ =~ f - dir = pkglibdir+"/"+File.dirname(f[4..-1]) + dir = rubylibdir+"/"+File.dirname(f[4..-1]) File.makedirs dir, true unless File.directory? dir File.install f, dir, 0644, true end for f in Dir["*.h"] - File.install f, archdir, 0644, true + File.install f, archlibdir, 0644, true end if RUBY_PLATFORM =~ /mswin32/ - File.makedirs archdir + "/win32", true - File.install "win32/win32.h", archdir + "/win32", 0644, true + File.makedirs archlibdir + "/win32", true + File.install "win32/win32.h", archlibdir + "/win32", 0644, true if File.exist? wdir+'/rubymw.lib' - File.install wdir+'/rubymw.lib', archdir, 0644, true + File.install wdir+'/rubymw.lib', archlibdir, 0644, true end end -File.install wdir+'/'+CONFIG['LIBRUBY_A'], archdir, 0644, true +File.install wdir+'/'+CONFIG['LIBRUBY_A'], archlibdir, 0644, true File.makedirs mandir, true File.install "ruby.1", mandir, 0644, true Dir.chdir wdir -File.install "config.h", archdir, 0644, true -File.install "rbconfig.rb", archdir, 0644, true +File.install "config.h", archlibdir, 0644, true +File.install "rbconfig.rb", archlibdir, 0644, true # vi:set sw=2: @@ -314,8 +314,6 @@ typedef struct RNode { #define NEW_PREEXE(b) NEW_SCOPE(b) #define NEW_POSTEXE() rb_node_newnode(NODE_POSTEXE,0,0,0) -NODE *rb_node_newnode(); - #define NOEX_PUBLIC 0 #define NOEX_UNDEF 1 #define NOEX_CFUNC 1 @@ -1544,7 +1544,11 @@ f_args : f_arg ',' f_optarg ',' f_rest_arg opt_f_block_arg $$ = NEW_ARGS(0, 0, -1); } -f_norm_arg : tIDENTIFIER +f_norm_arg : tCONSTANT + { + yyerror("formal argument must not be constant"); + } + | tIDENTIFIER { if (!is_local_id($1)) yyerror("formal argument must be local variable"); @@ -804,7 +804,7 @@ proc_setpgrp(argc, argv) rb_scan_args(argc, argv, "0"); if (setpgrp() < 0) rb_sys_fail(0); #endif - return Qnil; + return INT2FIX(0); #else rb_notimplement(); #endif @@ -835,7 +835,7 @@ proc_setpgid(obj, pid, pgrp) ipgrp = NUM2INT(pgrp); if (setpgid(ipid, ipgrp) < 0) rb_sys_fail(0); - return Qnil; + return INT2FIX(0); #else rb_notimplement(); #endif @@ -1,4 +1,4 @@ #define RUBY_VERSION "1.4.4" -#define RUBY_RELEASE_DATE "2000-03-09" +#define RUBY_RELEASE_DATE "2000-03-13" #define RUBY_VERSION_CODE 144 -#define RUBY_RELEASE_CODE 20000309 +#define RUBY_RELEASE_CODE 20000313 diff --git a/win32/ruby.def b/win32/ruby.def index 9b36bf5c83..97ac63c74b 100644 --- a/win32/ruby.def +++ b/win32/ruby.def @@ -133,6 +133,7 @@ EXPORTS mygetservbyname mygetservbyport myget_osfhandle + win32_getcwd win32_getenv ;array.c rb_mem_clear @@ -282,6 +283,7 @@ EXPORTS rb_funcall rb_funcall2 rb_funcall3 + rb_call_super rb_backtrace rb_frame_last_func rb_obj_instance_eval @@ -325,6 +327,7 @@ EXPORTS rb_file_s_expand_path ;gc.c xmalloc + xfree xcalloc xrealloc rb_global_variable @@ -372,7 +375,7 @@ EXPORTS rb_fdopen rb_file_open rb_file_sysopen - rb_io_synchronized + rb_io_synchronized rb_p rb_gets rb_str_setter |