summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog35
-rw-r--r--configure.in11
-rw-r--r--dir.c2
-rw-r--r--eval.c11
-rw-r--r--gc.c4
-rw-r--r--ruby.c1
-rw-r--r--string.c3
7 files changed, 59 insertions, 8 deletions
diff --git a/ChangeLog b/ChangeLog
index bc8e794..5253b5b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,11 +1,46 @@
+Wed Feb 28 11:02:41 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+
+ * string.c (rb_str_delete_bang): delete! should take at least 1
+ argument.
+
+ * ruby.c (load_file): add rb_gc() after loading to avoid
+ extraordinary memory growth.
+
+Wed Feb 28 05:01:40 2001 Koji Arai <JCA02266@nifty.ne.jp>
+
+ * dir.c (rb_glob_helper): "./foo" should match "foo", not "./foo".
+
Tue Feb 27 16:38:15 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
+ * eval.c (ev_const_get): retrieve Object's constant if no current
+ class is available (e.g. defining singleton class for Fixnums).
+
+ * eval.c (ev_const_defined): check Object's constant if no current
+ class is available (e.g. defining singleton class for Fixnums).
+
* time.c (time_timeval): negative time interval shoule not be
allowed.
* eval.c (proc_call): ignore block to `call' always, despite of
being orphan or not.
+Wed Feb 27 10:16:32 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * eval.c (rb_yield_0): should check based on rb_block_given_p()
+ and rb_f_block_given_p().
+
+Tue Feb 27 04:13:45 2001 Nobuyoshi Nakada <nobu.nakada@nifty.ne.jp>
+
+ * configure.in (frame-address): --enable-frame-address to allow
+ __builtin_frame_address() to be used.
+
+ * eval.c (stack_length): use __builtin_frame_address() based on
+ the macro USE_BUILTIN_FRAME_ADDRESS.
+
+ * gc.c (rb_gc): ditto.
+
+ * gc.c (Init_stack): ditto.
+
Mon Feb 26 16:20:27 2001 Yukihiro Matsumoto <matz@ruby-lang.org>
* ruby.c (proc_options): call ruby_show_version() just once.
diff --git a/configure.in b/configure.in
index ebdb0fd..c24b7b7 100644
--- a/configure.in
+++ b/configure.in
@@ -74,6 +74,17 @@ AC_ARG_ENABLE(fat-binary,
echo "."
fi
+case $target_cpu in
+ i?86) frame_address=yes;;
+ *) frame_address=no;;
+esac
+AC_ARG_ENABLE(frame-address,
+ [--enable-frame-address use GCC __builtin_frame_address(). ],
+ [frame_address=$enableval])
+if test $frame_address = yes; then
+ AC_DEFINE(USE_BUILTIN_FRAME_ADDRESS)
+fi
+
AC_ARG_PROGRAM
dnl Checks for programs.
diff --git a/dir.c b/dir.c
index 617dad7..fb0a6f7 100644
--- a/dir.c
+++ b/dir.c
@@ -630,7 +630,7 @@ rb_glob_helper(path, flag, func, arg)
if (m && strcmp(magic, "**") == 0) {
recursive = 1;
buf = ALLOC_N(char, strlen(base)+strlen(m)+3);
- sprintf(buf, "%s%s%s", base, (*base)?"":".", m);
+ sprintf(buf, "%s%s", base, *base ? m : m+1);
rb_glob_helper(buf, flag, func, arg);
free(buf);
}
diff --git a/eval.c b/eval.c
index 3501bc6..fd02b54 100644
--- a/eval.c
+++ b/eval.c
@@ -1431,8 +1431,8 @@ ev_const_defined(cref, id)
while (cbase && cbase->nd_clss != rb_cObject) {
struct RClass *klass = RCLASS(cbase->nd_clss);
- if (klass->iv_tbl &&
- st_lookup(klass->iv_tbl, id, 0)) {
+ if (NIL_P(klass)) return rb_const_defined(rb_cObject, id);
+ if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, 0)) {
return Qtrue;
}
cbase = cbase->nd_next;
@@ -1451,6 +1451,7 @@ ev_const_get(cref, id)
while (cbase && cbase->nd_clss != rb_cObject) {
struct RClass *klass = RCLASS(cbase->nd_clss);
+ if (NIL_P(klass)) return rb_const_get(rb_cObject, id);
if (klass->iv_tbl && st_lookup(klass->iv_tbl, id, &result)) {
return result;
}
@@ -2932,7 +2933,7 @@ rb_eval(self, n)
int noex;
if (NIL_P(ruby_class)) {
- rb_raise(rb_eTypeError, "no class to add method");
+ rb_raise(rb_eTypeError, "no class/module to add method");
}
if (ruby_class == rb_cObject && node->nd_mid == init) {
rb_warn("redefining Object#initialize may cause infinite loop");
@@ -3516,7 +3517,7 @@ rb_yield_0(val, self, klass, acheck)
int state;
static unsigned serial = 1;
- if (!ruby_frame->iter || !ruby_block) {
+ if (!(rb_block_given_p() || rb_f_block_given_p()) || !ruby_block) {
rb_raise(rb_eLocalJumpError, "yield called out of block");
}
@@ -4132,7 +4133,7 @@ stack_length(p)
alloca(0);
# define STACK_END (&stack_end)
#else
-# if defined(__GNUC__) && defined(__i386__)
+# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS)
VALUE *stack_end = __builtin_frame_address(0);
# else
VALUE *stack_end = alloca(1);
diff --git a/gc.c b/gc.c
index 1dbd86d..f60d950 100644
--- a/gc.c
+++ b/gc.c
@@ -949,7 +949,7 @@ rb_gc()
alloca(0);
# define STACK_END (&stack_end)
#else
-# if defined(__GNUC__) && defined(__i386__)
+# if defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS)
VALUE *stack_end = __builtin_frame_address(0);
# else
VALUE *stack_end = alloca(1);
@@ -1029,7 +1029,7 @@ Init_stack(addr)
#if defined(__human68k__)
extern void *_SEND;
rb_gc_stack_start = _SEND;
-#elif defined(__GNUC__) && defined(__i386__)
+#elif defined(__GNUC__) && defined(USE_BUILTIN_FRAME_ADDRESS)
rb_gc_stack_start = __builtin_frame_address(2);
#else
VALUE start;
diff --git a/ruby.c b/ruby.c
index 6c8bd8e..7d11ab1 100644
--- a/ruby.c
+++ b/ruby.c
@@ -833,6 +833,7 @@ load_file(fname, script)
else if (f != rb_stdin) {
rb_io_close(f);
}
+ rb_gc();
}
void
diff --git a/string.c b/string.c
index 37fa75a..374dc86 100644
--- a/string.c
+++ b/string.c
@@ -1982,6 +1982,9 @@ rb_str_delete_bang(argc, argv, str)
int init = 1;
int i;
+ if (argc < 1) {
+ rb_raise(rb_eArgError, "wrong # of arguments");
+ }
for (i=0; i<argc; i++) {
VALUE s = argv[i];